示例#1
0
文件: cmd.c 项目: 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;
}
示例#2
0
文件: cmd.c 项目: 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;
}
示例#3
0
文件: cmd.c 项目: abuchan/octoroach
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);
}