Esempio n. 1
0
File: cmd.c Progetto: Gwangpil/roach
unsigned char cmdEraseSectors(unsigned char type, unsigned char status, unsigned char length, unsigned char *frame, unsigned int src_addr){
    unsigned int numSamples = frame[0] + (frame[1] << 8);
    telemErase(numSamples);
    
    //Send confirmation packet; this only happens when flash erase is completed.
    radioSendData(src_addr, 0, CMD_ERASE_SECTORS, length, frame, 0);

    LED_RED = ~LED_RED;
    return 1;
}
Esempio n. 2
0
File: cmd.c Progetto: eschaler/roach
unsigned char cmdEraseSectors(unsigned char type, unsigned char status, unsigned char length, unsigned char *frame){
    unsigned int numSamples = frame[0] + (frame[1] << 8);
    telemErase(numSamples);
    
    //Send confirmation packet; this only happens when flash erase is completed.
    //Note that the destination is the hard-coded RADIO_DST_ADDR
    //todo : extract the destination address properly.
    radioSendData(RADIO_DST_ADDR, 0, CMD_ERASE_SECTORS, length, frame, 0);

    LED_RED = ~LED_RED;
    return 1;
}
Esempio n. 3
0
static void cmdEraseSector(unsigned char status, unsigned char length, unsigned char *frame) {
    //unsigned int numSamples = frame[0] + (frame[1] << 8);
    unsigned long numSamples = *((unsigned long*) (frame));

    telemErase(numSamples);

    //Send a confirmation packet
    Payload pld;
    pld = payCreateEmpty(4);
    paySetData(pld, 4, (unsigned char*) (&numSamples));
    paySetStatus(pld, status);
    paySetType(pld, CMD_ERASE_SECTORS);
    radioSendPayload((WordVal) macGetDestAddr(), pld);
}