Skip to content

Commit

Permalink
[examples] blue_pill: Logger in BSP
Browse files Browse the repository at this point in the history
  • Loading branch information
rleh committed Jan 11, 2021
1 parent f41b84c commit 6a092aa
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 33 deletions.
9 changes: 0 additions & 9 deletions examples/stm32f103c8t6_blue_pill/adns_9800/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@
#undef MODM_LOG_LEVEL
#define MODM_LOG_LEVEL modm::log::DEBUG

// Create an IODeviceWrapper around the Uart Peripheral we want to use
modm::IODeviceWrapper< Usart2, modm::IOBuffer::BlockIfFull > loggerDevice;

// Set all four logger streams to use the UART
modm::log::Logger modm::log::debug(loggerDevice);
modm::log::Logger modm::log::info(loggerDevice);
modm::log::Logger modm::log::warning(loggerDevice);
modm::log::Logger modm::log::error(loggerDevice);

class BlinkThread : public modm::pt::Protothread
{
public:
Expand Down
3 changes: 0 additions & 3 deletions examples/stm32f103c8t6_blue_pill/can/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
#include <modm/board.hpp>
#include <modm/debug/logger.hpp>

modm::IODeviceWrapper< Usart2, modm::IOBuffer::BlockIfFull > loggerDevice;
modm::log::Logger modm::log::info(loggerDevice);

// Set the log level
#undef MODM_LOG_LEVEL
#define MODM_LOG_LEVEL modm::log::INFO
Expand Down
11 changes: 0 additions & 11 deletions examples/stm32f103c8t6_blue_pill/environment/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ Bme280Thread bme280Thread;
#undef MODM_LOG_LEVEL
#define MODM_LOG_LEVEL modm::log::DEBUG

// Create an IODeviceWrapper around the Uart Peripheral we want to use
modm::IODeviceWrapper< Usart2, modm::IOBuffer::BlockIfFull > loggerDevice;
modm::IOStream stream(loggerDevice);

// Set all four logger streams to use the UART
modm::log::Logger modm::log::debug(loggerDevice);
modm::log::Logger modm::log::info(loggerDevice);
modm::log::Logger modm::log::warning(loggerDevice);
modm::log::Logger modm::log::error(loggerDevice);

// ----------------------------------------------------------------------------

using namespace Board;

Expand Down
4 changes: 4 additions & 0 deletions examples/stm32f103c8t6_blue_pill/logger/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#undef MODM_LOG_LEVEL
#define MODM_LOG_LEVEL modm::log::INFO

/*** The following code is included in the modm:board module (board.hpp),
* but might be useful if the BSP is not used.
// Create an IODeviceWrapper around the Uart Peripheral we want to use
modm::IODeviceWrapper< Usart2, modm::IOBuffer::BlockIfFull > loggerDevice;
Expand All @@ -30,6 +33,7 @@ modm::log::Logger modm::log::debug(loggerDevice);
modm::log::Logger modm::log::info(loggerDevice);
modm::log::Logger modm::log::warning(loggerDevice);
modm::log::Logger modm::log::error(loggerDevice);
*/


class BlinkThread : public modm::pt::Protothread
Expand Down
10 changes: 0 additions & 10 deletions examples/stm32f103c8t6_blue_pill/weight_scale_hx711/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ using namespace Board;
#undef MODM_LOG_LEVEL
#define MODM_LOG_LEVEL modm::log::DEBUG

// Create an IODeviceWrapper around the Uart Peripheral we want to use
modm::IODeviceWrapper< Usart1, modm::IOBuffer::BlockIfFull > loggerDevice;

// Set all four logger streams to use the UART
modm::log::Logger modm::log::debug(loggerDevice);
modm::log::Logger modm::log::info(loggerDevice);
modm::log::Logger modm::log::warning(loggerDevice);
modm::log::Logger modm::log::error(loggerDevice);


struct hx711_config : public modm::hx711::Config
{
using Sck = GpioOutputA9;
Expand Down

0 comments on commit 6a092aa

Please sign in to comment.