kopia lustrzana https://github.com/RobertGawron/IonizationChamber
bit operations moved to a spearate file
rodzic
aaba71a028
commit
eb1df327f6
|
@ -0,0 +1,8 @@
|
|||
#ifndef SRC_BITHANDLER_H_
|
||||
#define SRC_BITHANDLER_H_
|
||||
|
||||
// TODO a bit of type checking?
|
||||
#define GET_MSB(data) (data >> 8)
|
||||
#define GET_LSB(data) (data & 0xff)
|
||||
|
||||
#endif
|
|
@ -8,6 +8,7 @@
|
|||
#include "Logger.h"
|
||||
#include "stm8s_uart1.h"
|
||||
#include "PinoutConfiguration.h"
|
||||
#include "BitHandler.h"
|
||||
|
||||
//#define USE_PRINTF
|
||||
#if defined USE_PRINTF
|
||||
|
@ -46,11 +47,8 @@ void Logger_Print(Logger_DataFormat_t data)
|
|||
#if defined USE_PRINTF
|
||||
printf("%d\n\r", data);
|
||||
#else
|
||||
uint8_t msb = (data >> 8);
|
||||
uint8_t lsb = (data & 0xff);
|
||||
|
||||
putchar(msb);
|
||||
putchar(lsb);
|
||||
putchar(GET_MSB(data));
|
||||
putchar(GET_LSB(data));
|
||||
putchar('\n');
|
||||
putchar('\r');
|
||||
#endif
|
||||
|
|
Ładowanie…
Reference in New Issue