diff --git a/components/bm1397/include/common.h b/components/bm1397/include/common.h index 610d0b10f..4434ae9b6 100644 --- a/components/bm1397/include/common.h +++ b/components/bm1397/include/common.h @@ -1,6 +1,8 @@ #ifndef COMMON_H_ #define COMMON_H_ +#include + typedef struct __attribute__((__packed__)) { uint8_t job_id; @@ -13,8 +15,7 @@ static unsigned char _reverse_bits(unsigned char num) unsigned char reversed = 0; int i; - for (i = 0; i < 8; i++) - { + for (i = 0; i < 8; i++) { reversed <<= 1; // Left shift the reversed variable by 1 reversed |= num & 1; // Use bitwise OR to set the rightmost bit of reversed to the current bit of num num >>= 1; // Right shift num by 1 to get the next bit @@ -27,8 +28,7 @@ static int _largest_power_of_two(int num) { int power = 0; - while (num > 1) - { + while (num > 1) { num = num >> 1; power++; }