void main (void)
{
    initBoard();
    initUSB();
    blink(300,300);

    init_RF();
    appMainInit();

    usb_up();

    /* Enable interrupts */
    EA = 1;

    while (1)
    {  
        usbProcessEvents();
        appMainLoop();
    }

}
Beispiel #2
0
int main(void) {
	initialize();
	PAYLOAD_LENGTH = 32; //set the payload length of each packet
	unsigned char pipe_received;
	unsigned char j;
	init_RF(1);
	set_RX_addr(PIPE_ADDRESS_0, 0);
	char* packet = (char *) malloc(PAYLOAD_LENGTH);
	unsigned int packets_received = 0;
	while (1) {
		if (RX_FIFO_status() == 1) {
			pipe_received = read_RX_payload(packet);
			packets_received++;
		}
		if (time1 == 10000) {
			packets_received = packets_received / 10; //per second
			fprintf(stdout,"packets per second = %d \n", packets_received);
			packets_received = 0;
			time1 = 0;
		}
	}
}
void main (void)
{
    initBoard();
    initDMA();  // do this early so peripherals that use DMA can allocate channels correctly
    initAES();
    initUSB();
    blink(300,300);

    init_RF();
    appMainInit();

    usb_up();

    /* Enable interrupts */
    EA = 1;

    while (1)
    {  
        usbProcessEvents();
        appMainLoop();
    }

}