-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from ut-ras/modm-rtt
Use modm RTT implementation for logging
- Loading branch information
Showing
9 changed files
with
23 additions
and
4,154 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,17 +1,15 @@ | ||
#include <stdio.h> | ||
#include "modm/io.hpp" | ||
#include "modm/platform/rtt/rtt.hpp" | ||
|
||
#include "rtt/SEGGER_RTT.h" | ||
|
||
int printf_rtt(const char* fmt, ...) | ||
namespace communication | ||
{ | ||
int r; | ||
char data[64]; | ||
va_list params; | ||
|
||
va_start(params, fmt); | ||
r = vsnprintf(data, 64, fmt, params); | ||
va_end(params); | ||
|
||
SEGGER_RTT_Write(0, data, r); | ||
return r; | ||
} | ||
class RttStream : public modm::IOStream | ||
{ | ||
public: | ||
RttStream() : IOStream(device) {} | ||
|
||
private: | ||
modm::platform::Rtt rtt{0}; | ||
modm::IODeviceObjectWrapper<modm::platform::Rtt, modm::IOBuffer::DiscardIfFull> device{rtt}; | ||
}; | ||
} // namespace communication |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.