-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hal/armv7m: Support RTT as an early console
Currently RTT is available as a plo device and also mirrors UART output via hooks. This change makes it possible to replace UART completely by RTT - just define `UART_CONSOLE_PLO` as empty and keep RTT_ENABLED_PLO truthy (enabled by default). A print is moved from `lib_consoleSet()` to console command to avoid output before the first plo log ("Phoenix-RTOS loader ..."). JIRA: RTOS-754
- Loading branch information
Showing
9 changed files
with
133 additions
and
1 deletion.
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
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
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* Operating system loader | ||
* | ||
* Generic useful macros | ||
* | ||
* Copyright 2024 Phoenix Systems | ||
* Author: Daniel Sawka | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#ifndef _LIB_HELPERS_H_ | ||
#define _LIB_HELPERS_H_ | ||
|
||
/* | ||
These macros should only be used in `#if` and `#elif` directives, because undefined identifiers expand to 0 there. | ||
Otherwise there will be "use of undefined identifier" errors (an exception: identifier is first checked for | ||
existence with e.g. `#ifdef`). | ||
Anything that expands to a numerical expression (or to an empty value) is fine. String literals don't work. | ||
*/ | ||
|
||
/* | ||
These macros produce a logically correct result only if X is defined. You may use `#ifdef` or `defined()` | ||
for this purpose. Unfortunately, `defined()` cannot be conveniently put inside a macro as this is undefined | ||
behavior (see -Wexpansion-to-defined for details), so you have to use it directly on the spot, for example: | ||
`#if defined(PERIPH1) && !ISEMPTY(PERIPH1) | ||
// Use PERIPH1 | ||
#endif` | ||
*/ | ||
|
||
/* True if X is empty (has no value). The result in #if is valid only if defined(X) is true */ | ||
#define ISEMPTY(X) ((0 - X - 1) == 1 && (X + 0) != -2) | ||
|
||
#endif |