volatile register uint32_t __R30;
void main(void)
{
        uint8_t result = 0;
        while(1) {
                /* loop until we get the spinlock */
                result = 0;
                do {
                        __R30 ^= (1 << DEBUG_PIN_SHIFT_C);
                        result = spinlock_acquire(SPINLOCK_FLAG);
                } while (result != 1);

                __R30 |= (1 << DEBUG_PIN_SHIFT_B);

                //different delay for each core
                #if PRU0
                __delay_cycles(1000);
                #else
                __delay_cycles(300);
                #endif
                __R30 &= ~(1 << DEBUG_PIN_SHIFT_B);

                /* now release the spinlock */
                spinlock_release(SPINLOCK_FLAG);
