-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 additions
and
2 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,5 +1,6 @@ | ||
target_sources(pslab-firmware.elf PRIVATE | ||
buffer.c | ||
debug.c | ||
delay.c | ||
device.c | ||
interval.c | ||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdbool.h> | ||
|
||
#include "../bus/uart/uart.h" | ||
#include "../commands.h" | ||
#include "debug.h" | ||
|
||
response_t DEBUG_is_enabled(void) { | ||
#ifdef PSLAB_DEBUG | ||
bool const IS_DEBUG_ENABLED = true; | ||
#else | ||
bool const IS_DEBUG_ENABLED = false; | ||
#endif // PSLAB_DEBUG | ||
|
||
UART1_Write(IS_DEBUG_ENABLED); | ||
return DO_NOT_BOTHER; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef _DEBUG_H | ||
#define _DEBUG_H | ||
|
||
#include "../commands.h" | ||
|
||
#ifdef PSLAB_DEBUG | ||
#define DEBUG_write_u8(byte) UART1_Write(byte) | ||
#define DEBUG_write_u16(word) UART1_WriteInt(word) | ||
#define DEBUG_write_u32(dword) UART1_write_u32(dword) | ||
#else | ||
#define DEBUG_write_u8(byte) ((void)byte) | ||
#define DEBUG_write_u16(word) ((void)word) | ||
#define DEBUG_write_u32(dword) ((void)dword) | ||
#endif // PSLAB_DEBUG | ||
|
||
response_t DEBUG_is_enabled(void); | ||
|
||
#endif // _DEBUG_H |