Mod to ISR and Tasks ok working
This commit is contained in:
14
RotaxMonitor/src/utils.cpp
Normal file
14
RotaxMonitor/src/utils.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "utils.h"
|
||||
|
||||
std::string printBits(uint32_t value) {
|
||||
std::string result;
|
||||
for (int i = 31; i >= 0; i--) {
|
||||
// ottieni il singolo bit
|
||||
result += ((value >> i) & 1) ? '1' : '0';
|
||||
// aggiungi uno spazio ogni 8 bit, tranne dopo l'ultimo
|
||||
if (i % 8 == 0 && i != 0) {
|
||||
result += ' ';
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user