bit operations moved to a spearate file

pull/104/head
RobertGawron 2019-08-04 11:26:25 +01:00
rodzic aaba71a028
commit eb1df327f6
4 zmienionych plików z 13 dodań i 7 usunięć

Wyświetl plik

@ -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

0
software/Firmware/Inc/Logger.h 100755 → 100644
Wyświetl plik

Wyświetl plik

@ -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