File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 43
43
44
44
#define sensirion_hal_sleep_us sensirion_i2c_hal_sleep_usec
45
45
46
- void print_ushort_array (uint16_t * array , uint16_t len ) {
47
- uint16_t i = 0 ;
48
- printf ("0x" );
49
- for (; i < len ; i ++ ) {
50
- printf ("%04x" , array [i ]);
51
- }
46
+ void convert_and_print_serial (uint16_t * serial_raw ) {
47
+ uint64_t serial_as_int = 0 ;
48
+ sensirion_common_to_integer ((uint8_t * )serial_raw , (uint8_t * )& serial_as_int ,
49
+ LONG_INTEGER , 6 );
50
+ printf ("0x%" PRIx64 , serial_as_int );
52
51
}
53
52
54
53
int main (void ) {
@@ -81,7 +80,7 @@ int main(void) {
81
80
return error ;
82
81
}
83
82
printf ("serial number: " );
84
- print_ushort_array (serial_number , 3 );
83
+ convert_and_print_serial (serial_number );
85
84
printf ("\n" );
86
85
//
87
86
// If temperature offset and/or sensor altitude compensation
You can’t perform that action at this time.
0 commit comments