-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compilation errors when UART is disabled
- Loading branch information
1 parent
80fa310
commit 9dc79ce
Showing
7 changed files
with
64 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
#ifndef DEBUGGING_H | ||
#define DEBUGGING_H | ||
|
||
#ifdef ENABLE_UART | ||
|
||
#include "driver/uart.h" | ||
#include "driver/bk4819.h" | ||
#include "string.h" | ||
#include "external/printf/printf.h" | ||
#include "am_fix.h" | ||
|
||
|
||
static inline void LogUart(const char * const str) | ||
static inline void LogUart(const char *const str) | ||
{ | ||
UART_Send(str, strlen(str)); | ||
UART_Send(str, strlen(str)); | ||
} | ||
|
||
static inline void LogRegUart(uint16_t reg) | ||
{ | ||
uint16_t regVal = BK4819_ReadRegister(reg); | ||
char buf[32]; | ||
sprintf(buf, "reg%02X: %04X\n", reg, regVal); | ||
LogUart(buf); | ||
uint16_t regVal = BK4819_ReadRegister(reg); | ||
char buf[32]; | ||
sprintf(buf, "reg%02X: %04X\n", reg, regVal); | ||
LogUart(buf); | ||
} | ||
|
||
|
||
static inline void LogPrint() | ||
{ | ||
uint16_t rssi = BK4819_GetRSSI(); | ||
uint16_t reg7e = BK4819_ReadRegister(0x7E); | ||
char buf[32]; | ||
sprintf(buf, "reg7E: %d %2d %6d %2d %d rssi: %d\n", | ||
(reg7e >> 15), (reg7e >> 12) & 0b111, (reg7e >> 5) & 0b1111111, (reg7e >> 2) & 0b111, (reg7e >> 0) & 0b11, rssi); | ||
LogUart(buf); | ||
uint16_t rssi = BK4819_GetRSSI(); | ||
uint16_t reg7e = BK4819_ReadRegister(0x7E); | ||
char buf[32]; | ||
sprintf(buf, "reg7E: %d %2d %6d %2d %d rssi: %d\n", (reg7e >> 15), | ||
(reg7e >> 12) & 0b111, (reg7e >> 5) & 0b1111111, | ||
(reg7e >> 2) & 0b111, (reg7e >> 0) & 0b11, rssi); | ||
LogUart(buf); | ||
} | ||
|
||
#endif | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters