elbear_arduino_bsp/cores/arduino/board.cpp
khristolyubov e36b851783 ready to alpha
подготовка к альфа-тестированию
2024-08-19 22:44:04 +07:00

37 lines
699 B
C++

#include "board.h"
#include "mik32_hal_pcc.h"
#include "Arduino.h"
// --------------------- init --------------------- //
// called before setup()
void pre_init(void)
{
HAL_Init();
// gpio clock
__HAL_PCC_GPIO_0_CLK_ENABLE();
__HAL_PCC_GPIO_1_CLK_ENABLE();
__HAL_PCC_GPIO_2_CLK_ENABLE();
__HAL_PCC_GPIO_IRQ_CLK_ENABLE();
// for delays
SysTick_Init();
}
// called after setup()
void post_init(void)
{
// enable global interrupts by default
interrupts();
}
// --------------------- other --------------------- //
// print text if Serial is enabled
extern "C" void ErrorMsgHandler(const char * msg)
{
if(Serial)
Serial.println(msg);
}