add Chapter07
This commit is contained in:
30
Chapter07/error_handling/app/src/main.cpp
Normal file
30
Chapter07/error_handling/app/src/main.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
|
||||
#include <stm32f072xb.h>
|
||||
|
||||
#include <hal.hpp>
|
||||
#include <uart_stm32.hpp>
|
||||
|
||||
#include <retarget.hpp>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
hal::init();
|
||||
|
||||
hal::uart_stm32 uart(USART2);
|
||||
uart.init();
|
||||
|
||||
uart.write("Hi from main function!\r\n");
|
||||
|
||||
retarget::set_stdio_uart(&uart);
|
||||
|
||||
printf("Printing using printf\r\n");
|
||||
|
||||
printf("PC: 0x%08lX\r\n", hal::get_pc());
|
||||
|
||||
while(true)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user