#include "driverlib.h" #include "device.h" #include "ipc.h" #include "struct.h" shared_t data2; uint32_t dbg_flag = 0; //uint32_t data2; interrupt void ipc0_ISR(void) { uint32_t cmd, addr, data; shared_t *ptr; // Clear interrupt flags. Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1); // Read the data from the IPC registers. IPC_readCommand(IPC_CPU2_L_CPU1_R, IPC_FLAG0, IPC_ADDR_CORRECTION_ENABLE, &cmd, &addr, &data); // Acknowledge IPC0 flag from remote. IPC_ackFlagRtoL(IPC_CPU2_L_CPU1_R, IPC_FLAG0); dbg_flag = 2; ptr = (shared_t *)addr; memcpy(&data2, ptr, sizeof(shared_t)); } void main(void) { // Configure system clock and PLL, enable peripherals, and configure // flash if used. Device_init(); // Initialize the PIE module and vector table. Interrupt_initModule(); Interrupt_initVectorTable(); // Clear any IPC flags if set already IPC_clearFlagLtoR(IPC_CPU2_L_CPU1_R, IPC_FLAG_ALL); // Enable IPC0 interrupt. IPC_registerInterrupt(IPC_CPU2_L_CPU1_R, IPC_INT0, ipc0_ISR); Interrupt_enable(IPC_INT0); // Enable global interrupts. EINT; // Enable real-time debug. ERTM; // Synchronize both the cores. IPC_sync(IPC_CPU2_L_CPU1_R, IPC_FLAG17); dbg_flag = 1; for (;;) { // Do nothing. NOP; } }