37 lines
699 B
C++
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);
|
|
}
|
|
|
|
|