Move CC1310 platform init around

This commit is contained in:
Nanosonde 2020-10-22 17:37:17 +02:00
parent 7d9ff0a602
commit 2642e490ae
5 changed files with 12 additions and 11 deletions

4
.gitignore vendored
View File

@ -275,4 +275,6 @@ doc/build
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
.vscode/ipch
.vscode/.cortex-debug.registers.state.json
.vscode/.cortex-debug.peripherals.state.json

View File

@ -10,7 +10,7 @@ void setup()
pKnx = new KnxFacade<CC1310Platform, Bau07B0>;
KnxFacade<CC1310Platform, Bau07B0> &knx = *pKnx;
knx.platform().earlyInit();
knx.platform().init();
knx.readMemory();

View File

@ -107,13 +107,6 @@ int main(void)
// Call driver init functions before starting NoRTOS/RTOS
Board_init();
// TI Drivers init before starting NoRTOS/RTOS
UART_init();
NVS_init();
//I2C_init();
//SPI_init();
//TRNG_init();
// Start NoRTOS (this just enables the HwI globally and returns immediately as
// we are not using RTOS here)
NoRTOS_start();

View File

@ -76,8 +76,14 @@ CC1310Platform::~CC1310Platform()
{
}
void CC1310Platform::earlyInit()
void CC1310Platform::init()
{
// TI Drivers init
// According to SDK docs it is safe to call them AFTER NoRTOS_Start()
// If RTOS is used and multiple thread use the same driver, then the init shall be performed before BIOS_Start()
UART_init();
NVS_init();
// Init UART
InitUART();

View File

@ -14,7 +14,7 @@ class CC1310Platform : public Platform
CC1310Platform();
virtual ~CC1310Platform();
void earlyInit();
void init();
// basic stuff
virtual void restart() final;