Ejemplo n.º 1
0
void init(void)
{
    int i;
    volatile WordVal src_addr = {SRC_ADDR};
    volatile WordVal src_pan_id = {SRC_PAN_ID};

    SetupClock();
    SwitchClocks();
    SetupPorts();

    for (i = 0; i < 6; i++)
    {
        LED_RED = ~LED_RED;
        delay_ms(50);
        LED_YLW1 = ~LED_YLW1;
        delay_ms(50);
        LED_YLW2 = ~LED_YLW2;
        delay_ms(50);
        LED_BLU = ~LED_BLU;
        delay_ms(50);
    }

    SetupUART1();
    SetupInterrupts();
    EnableIntU1TX;
    EnableIntU1RX;
    radioInit(src_addr, src_pan_id, 150, 150);
    atSetPromMode(1);  //This turns off Automatic Acknowledgements and puts the radio in prom mode
    radioSetChannel(MY_CHAN); //Set to my channel

    //atSetAntDiversity(1);
}
Ejemplo n.º 2
0
int main(int argc, char** argv) {
    volatile int Foo;
    
    SetupClock();
    
    Foo = 12;
    
    SetupUART1();
#define redLED LATAbits.LATA4
    //printf("Hello world\r\n");
    TRISAbits.TRISA4 = 0;
    redLED = 1;
    while(1);
    return (EXIT_SUCCESS);
}