#include "driverlib.h" #include "device.h" #include "ipc.h" #include "struct.h" #pragma DATA_SECTION(data1, "MSGRAM_CPU1_TO_CPU2") shared_t data1; //uint32_t data1; void main(void) { Device_init(); uint16_t i = 0; #ifdef _STANDALONE #ifdef _FLASH // TODO check to see if this breaks. Device_bootCPU2(BOOTMODE_BOOT_TO_FLASH_SECTOR0); #else // TODO this breaks the RAM build. Device_bootCPU2(BOOTMODE_BOOT_TO_M0RAM); #endif #endif // Initialize the PIE module and vector table. Interrupt_initModule(); Interrupt_initVectorTable(); // // Clear any IPC flags if set already // IPC_clearFlagLtoR(IPC_CPU1_L_CPU2_R, IPC_FLAG_ALL); // // Synchronize both the cores. // IPC_sync(IPC_CPU1_L_CPU2_R, IPC_FLAG17); // Enable global interrupts. EINT; // Enable real-time debug. ERTM; for (;;) { if( ! IPC_isFlagBusyLtoR(IPC_CPU1_L_CPU2_R, IPC_FLAG0)) { i++; data1.id = i; data1.value = 10.5 * i; IPC_sendCommand(IPC_CPU1_L_CPU2_R, IPC_FLAG0, IPC_ADDR_CORRECTION_ENABLE, 0, (uint32_t)&data1, sizeof(data1)); DEVICE_DELAY_US(200000); }; } }