Exemplo n.º 1
0
void sendRadioBursts()
{
    uint16 time = (uint16)getMs();

    if ((uint16)(time - lastBurst) > 1000)
    {
        lastBurst = time;
        toggle_channel();
        currentBurstId++;
        packetsSent = 0;
    }

    if (packetsSent < 100 && (MARCSTATE == 1))
    {
        packet[1] = packetsSent & 1;
        packet[2] = currentBurstId;
        packet[3] = packetsSent;
        packetsSent++;

        RFIF &= ~(1<<4);                   // Clear IRQ_DONE
        DMAARM |= (1<<DMA_CHANNEL_RADIO);  // Arm DMA channel
        RFST = 3;                          // Switch radio to TX
    }

}
Exemplo n.º 2
0
static void click_ext(void *u,int s)	{	toggle_channel(s << 5);	}
Exemplo n.º 3
0
static void click_dmc(void *u,int s)	{	toggle_channel(s << 4);	}
Exemplo n.º 4
0
static void click_noise(void *u,int s)	{	toggle_channel(s << 3);	}
Exemplo n.º 5
0
static void click_tri(void *u,int s)	{	toggle_channel(s << 2);	}
Exemplo n.º 6
0
static void click_sq2(void *u,int s)	{	toggle_channel(s << 1);	}
Exemplo n.º 7
0
static void click_sq1(void *u,int s)	{	toggle_channel(s << 0);	}