1. MoteID 功能

void moteid_init(void)
{
   uint32_t id;
   stm32f10xx_flash_read(MOTE_ID_FLASH_ADDR,&id,4);
   moteid = id >> 16;
}

uint16_t get_moteid(void)
{
  return moteid;
}

moteID test.bin

PROCESS(led_process, "Blink1");
PROCESS_THREAD(led_process, ev, data)
{
  PROCESS_BEGIN();

  while(1)
  {
    static struct etimer et;
    etimer_set(&et, CLOCK_SECOND/1);
    PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));    
    PRINTF("The moteid is %d \r\n",get_moteid());
  }
  PROCESS_END();
}
Copyright © Zhang XiaoYuan 2019 all right reserved,powered by Gitbook该文件修订时间: 2020-02-05 13:26:50

results matching ""

    No results matching ""