-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug: Adds RTT support to bootloader #1362
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,16 +20,22 @@ | |
#endif | ||
#include "rust/rust.h" | ||
|
||
#if defined(BOOTLOADER) | ||
#define PREFIX "boot" | ||
#else | ||
#define PREFIX "app" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
#endif | ||
|
||
void platform_init(void) | ||
{ | ||
oled_init(); | ||
#if !defined(BOOTLOADER) | ||
// The factory setup image already has a c implementation of RTT. | ||
#if FACTORYSETUP != 1 | ||
// these two functions are noops if "rtt" feature isn't enabled in rust | ||
rust_rtt_init(); | ||
util_log("platform_init"); | ||
util_log(PREFIX ": platform_init"); | ||
#endif | ||
#if !defined(BOOTLOADER) | ||
sd_mmc_start(); | ||
#endif | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we maybe call this in util_log() by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flush will wait until the debugger reads out the buffer and updates the read pointer. It isn't necessary in general, but if we don't do it here messages from the bootloader might be overwritten by the firmware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling it every time will basically make RTT sync, when its speed/efficiency comes from it being async.