当前位置: 首页>>代码示例>>C++>>正文


C++ rtimer_init函数代码示例

本文整理汇总了C++中rtimer_init函数的典型用法代码示例。如果您正苦于以下问题:C++ rtimer_init函数的具体用法?C++ rtimer_init怎么用?C++ rtimer_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rtimer_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int
main()
{
  configure_mcu_clocks();
  uart_init(115200);
  printf("Platform init complete, starting contiki init\n");

  clock_init();
  rtimer_init();
  leds_init();
  process_init();
#if WITH_SERIAL_LINE_INPUT
  uart_set_input(serial_line_input_byte);
  serial_line_init();
#endif
  process_start(&etimer_process, NULL);
  ctimer_init();
  autostart_start(autostart_processes);
  while(1) {
    do {
	// meant to do some sleeping here, if we want to save power...
	//
    } while(process_run() > 0);
  }
  return 0;
}
开发者ID:frtos-wpan,项目名称:contiki-outoftree,代码行数:26,代码来源:contiki-main.c

示例2: main

int
main()
{
    //dubug uart init
    dbg_setup_uart();
    clock_init();
		rtimer_init();
	
    //process init first
    process_init();

    uart1_set_input(serial_line_input_byte);
    serial_line_init();

    process_start(&etimer_process, NULL);

    /* with keil, can't use the AUTOSTART_PROCESSES to add the exmaple or it will be error
     * So in this project, start the process manual.
     */
#ifdef WITH_LED_BLINK
    process_start(&blink_process, NULL);
#endif
#ifdef WITH_CONTIKI_SHELL
    process_start(&stm32_shell_process, NULL);
#endif
#ifdef WITH_RTIMER_TEST
		process_start(&rtimer_ex_process, NULL);
#endif
    while(1)
    {
        do {}
        while(process_run()>0);
        idle_count++;
    }
}
开发者ID:ehigh2014,项目名称:contiki_stm32_keil,代码行数:35,代码来源:contiki-main.c

示例3: ule6loGI_init

ule6lo_status_t ule6loGI_init(const ule6lo_IPEI_t *IPEIAddr) {
	process_init();
	process_start(&etimer_process, NULL);
	ctimer_init();
	rtimer_init();
	set_rime_addr();
	//queuebuf_init();
	netstack_init();


	printf("Size of uip_ipeiaddr.addr = %i\n", (int)(sizeof(uip_ipeiaddr.addr)));
	if( IPEIAddr != NULL){
	    printf("Size of uip_ipeiaddr.addr = %i\n", (int)(sizeof(uip_ipeiaddr.addr)));
	    uip_ipeiaddr.addr[0] = 0x00;
	    memcpy(&uip_ipeiaddr.addr[1], IPEIAddr, sizeof(ule6lo_IPEI_t));
	}
#if ! FILTERED_BORDER_ROUTER
	process_start(&tcpip_process, NULL);
#endif

	autostart_start(autostart_processes);

	stack_status = STATUS_SUCCESS;
	return stack_status;
}
开发者ID:ULE-Alliance,项目名称:ULE_6LowPan,代码行数:25,代码来源:ule6loGI_6LBR.c

示例4: main

int
main(void)
{
  cpu_init();
  /* Initialize UART connected to Galileo Gen2 FTDI header */
  quarkX1000_uart_init(QUARK_X1000_UART_1);
  clock_init();
  rtimer_init();

  printf("Starting Contiki\n");

  ENABLE_IRQ();

  process_init();
  procinit_init();
  ctimer_init();
  autostart_start(autostart_processes);

  eth_init();

  while(1) {
    process_run();
  }

  return 0;
}
开发者ID:Babody,项目名称:contiki,代码行数:26,代码来源:contiki-main.c

示例5: main

int
main(void)
{

  leds_init();

  leds_on(LEDS_RED);

  /* Initialize USART */
  init_usart();
  
  /* Clock */
  clock_init();

  leds_on(LEDS_GREEN);

  ds2401_init();

  random_init(0);

  rtimer_init();

  /* Process subsystem */
  process_init();

  process_start(&etimer_process, NULL);

  ctimer_init();

  leds_on(LEDS_YELLOW);

  init_net();

  node_id_restore();
  
  printf_P(PSTR(CONTIKI_VERSION_STRING " started. Node id %u, using %s.\n"),
                                                       node_id, rime_mac->name);
  printf_P(PSTR("MAC %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"),
	 ds2401_id[0], ds2401_id[1], ds2401_id[2], ds2401_id[3],
	 ds2401_id[4], ds2401_id[5], ds2401_id[6], ds2401_id[7]);

  leds_off(LEDS_ALL);

  /* Autostart processes */
  autostart_start(autostart_processes);

  /* Main scheduler loop */
  do {

    process_run();

  }while(1);

  return 0;
}
开发者ID:arbraham,项目名称:hummingbird,代码行数:55,代码来源:contiki-micaz-main.c

示例6: main

/*---------------------------------------------------------------------------*/
int main(void)
{

  /*
   * Initialise hardware.
   */
  //halInit();
    clock_init();

  //uart1_init(115200);

    // Led initialisation
    leds_init();
    leds_on(LEDS_RED);

    /* configure ethernet (GPIOs, clocks, MAC, DMA) */
    ETH_BSP_Config();



  //INTERRUPTS_ON();

    /*
     * Initialize Contiki and our processes.
     */

    process_init();
/*
#if WITH_SERIAL_LINE_INPUT
  uart1_set_input(serial_line_input_byte);
  serial_line_init();
#endif*/
  /* rtimer and ctimer should be initialized before radio duty cycling layers*/
    rtimer_init();
  /* etimer_process should be initialized before ctimer */
    process_start(&etimer_process, NULL);
    ctimer_init();

    netstack_init();

    procinit_init();

    autostart_start(autostart_processes);

    while (1)
    {
        int r;

        do
        {
            leds_toggle(LEDS_YELLOW);
            r = process_run();
        } while (r > 0);
    }
}
开发者ID:jensnielsen,项目名称:contiki,代码行数:56,代码来源:contiki-main.c

示例7: main

int main()
{

	//setup internal clock for 80MHz/40MIPS
	//7.37/2=3.685*43=158.455/2=79.2275
	CLKDIVbits.PLLPRE=0; // PLLPRE (N2) 0=/2 
	PLLFBD=41; //pll multiplier (M) = +2
	CLKDIVbits.PLLPOST=0;// PLLPOST (N1) 0=/2
    while(!OSCCONbits.LOCK);//wait for PLL ready

	SRbits.IPL = 0;	// All interupt levels enabled
		
  dbg_setup_uart();
  printf("DP Web Platform - %s started.\n", version);
  resetCheck();
  randomSeed();
  
  rtimer_init();  
  printf("main: leds init\n");  
  leds_init();
  printf("main: process init\n");
  process_init();
  printf("main: etimer init\n");
  process_start(&etimer_process, NULL);
  printf("main: clock init\n");
  clock_init();

  // Note, readMAC() uses eeprom routines, which require clock_init() to setup clock hardware
  readMAC();  
  printf("main: eth start\n");
  process_start(&enc28j60_process, NULL);
   
  printf("main: tcpip start\n");
  process_start(&tcpip_process, NULL);		// invokes uip_init();
  
  process_start(&announce_process, NULL);
  process_start(&dhcp_process, NULL);
  process_start(&resolv_process, NULL);
  process_start(&ntp_process, NULL);
  
  printf("main: autostart\n");
  autostart_start(autostart_processes);
  
  printf("main: all processes running\n");
  
  while(1) {
    do {
    } while(process_run() > 0);
    idle_count++;
	
    /* Idle! */
  }
  return 0;
}
开发者ID:Paulholland,项目名称:contiki-dspic,代码行数:54,代码来源:contiki-dp-webplatform-main.c

示例8: main

/*---------------------------------------------------------------------------*/
int
main(void)
{

  leds_init();

  leds_on(LEDS_RED);

  /* Initialize USART */
  init_usart();
  
  /* Clock */
  clock_init();

  leds_on(LEDS_GREEN);

  ds2401_init();
  
  node_id_restore();

  random_init(ds2401_id[0] + node_id);

  rtimer_init();

  /* Process subsystem */
  process_init();

  process_start(&etimer_process, NULL);

  ctimer_init();

  leds_on(LEDS_YELLOW);
  
  init_net();
  
  printf_P(PSTR(CONTIKI_VERSION_STRING " started. Node id %u\n"), node_id);

  leds_off(LEDS_ALL);

  /* Autostart processes */
  autostart_start(autostart_processes);

  mmem_init();
  /* Main scheduler loop */
  do {

    process_run();

  }while(1);

  return 0;
}
开发者ID:21moons,项目名称:contiki,代码行数:53,代码来源:contiki-iris-main.c

示例9: initialize

void
initialize(void)
{
  watchdog_init();
  watchdog_start();
  
#if STACKMONITOR
  /* Simple stack pointer highwater monitor. Checks for magic numbers in the main
   * loop. In conjuction with TESTRTIMER, never-used stack will be printed
   * every STACKMONITOR seconds.
   */
{
extern uint16_t __bss_end;
uint16_t p=(uint16_t)&__bss_end;
    do {
      *(uint16_t *)p = 0x4242;
      p+=4;
    } while (p<SP-4); //don't overwrite our own stack
}
#endif

  /* rtimers needed for radio cycling */
  rtimer_init();

  rs232_init(RS232_PORT_0, BAUD_RATE(38400), USART_DATA_BITS_8 | USART_PARITY_NONE | USART_STOP_BITS_1);
  rs232_redirect_stdout(RS232_PORT_0);

  clock_init();
  sei();

  /* Initialize drivers and event kernel */
  process_init();
 
  led_init();

#if 0
  procinit_init();
#else
  process_start(&etimer_process, NULL);
  process_start(&led_process, NULL);
  process_start(&led2_process, NULL);
#endif

  PRINTA(CONTIKI_VERSION_STRING " started\r\n");

  /* Comment this out if autostart_processes not defined at link */
  /* Note AUTOSTART_PROCESSES(...) is only effective in the .co module */
  autostart_start(autostart_processes);
  
}
开发者ID:Ammar-85,项目名称:contiki-arduino,代码行数:50,代码来源:contiki-stk500-main.c

示例10: main

/* Kernel entrypoint */
int
main(void)
{
  uintptr_t *func_ptr;

#ifdef X86_CONF_RESTRICT_DMA
  quarkX1000_imr_conf();
#endif
  irq_init();
  quarkX1000_uart_init();
  /* Initialize UART connected to Galileo Gen1 3.5mm audio-style jack or
   * Galileo Gen2 FTDI header
   */
  quarkX1000_uart_init_port(QUARK_X1000_UART_1, 115200);
  SET_EXCEPTION_HANDLER(13, 1, gp_fault_handler);
  clock_init();
  rtimer_init();

  pci_root_complex_init();
  quarkX1000_eth_init();
  quarkX1000_i2c_init();
  quarkX1000_i2c_configure(QUARKX1000_I2C_SPEED_STANDARD,
                           QUARKX1000_I2C_ADDR_MODE_7BIT);
  /* The GPIO subsystem must be initialized prior to configuring pinmux, because
   * the pinmux configuration automatically performs GPIO configuration for the
   * relevant pins.
   */
  quarkX1000_gpio_init();
  /* use default pinmux configuration */
  if(galileo_pinmux_initialize() < 0) {
    fprintf(stderr, "Failed to initialize pinmux\n");
  }
  shared_isr_init();

  /* The ability to remap interrupts is not needed after this point and should
   * thus be disabled according to the principle of least privilege.
   */
  pci_root_complex_lock();

  func_ptr = (uintptr_t *)&_sdata_kern_startup_func;
  while(func_ptr != (uintptr_t *)&_edata_kern_startup_func) {
    ((void (*)(void))*func_ptr)();

    func_ptr++;
  }

  prot_domains_leave_main();

  return 0;
}
开发者ID:1847123212,项目名称:contiki,代码行数:51,代码来源:contiki-main.c

示例11: main

/*---------------------------------------------------------------------------*/
int
main(int argc, char **argv)
{
  /*
   * Initalize hardware.
   */
  msp430_cpu_init();
  clock_init();
  leds_init();
  leds_on(LEDS_RED);

  clock_wait(100);

  uart0_init(BAUD2UBR(115200)); /* Must come before first printf */
#if WITH_UIP
  slip_arch_init(BAUD2UBR(115200));
#endif /* WITH_UIP */

  xmem_init();

  rtimer_init();
  /*
   * Hardware initialization done!
   */

  /* Restore node id if such has been stored in external mem */
  node_id_restore();

  /* If no MAC address was burned, we use the node ID. */
  if(node_mac[0] | node_mac[1] | node_mac[2] | node_mac[3] |
     node_mac[4] | node_mac[5] | node_mac[6] | node_mac[7]) {
    node_mac[0] = 0xc1;  /* Hardcoded for Z1 */
    node_mac[1] = 0x0c;  /* Hardcoded for Revision C */
    node_mac[2] = 0x00;  /* Hardcoded to arbitrary even number so that
                            the 802.15.4 MAC address is compatible with
                            an Ethernet MAC address - byte 0 (byte 2 in
                            the DS ID) */
    node_mac[3] = 0x00;  /* Hardcoded */
    node_mac[4] = 0x00;  /* Hardcoded */
    node_mac[5] = 0x00;  /* Hardcoded */
    node_mac[6] = node_id >> 8;
    node_mac[7] = node_id & 0xff;
  }
开发者ID:mwasilak,项目名称:contiki-mirror,代码行数:44,代码来源:contiki-z1-main.c

示例12: network_initialization

static int network_initialization(void)
{
	/* Initialize and start Contiki uIP stack */
	clock_init();

	rtimer_init();
	ctimer_init();

	process_init();
	tcpip_set_outputfunc(net_tcpip_output);

	process_start(&tcpip_process, NULL);
	process_start(&simple_udp_process, NULL);
	process_start(&etimer_process, NULL);

	slip_start();

	return 0;
}
开发者ID:pafcndg,项目名称:ndgIqSoftwareKit,代码行数:19,代码来源:net_init.c

示例13: another_net

int another_net(void) {

	clock_init();



	random_init(MOTE_ID);
	init_net(MOTE_ID);


	process_init();

	start_radio_task();

	process_start(&etimer_process, NULL);

	ctimer_init();
	rtimer_init();

	procinit_init();

	autostart_start(autostart_processes);
	start_udp_server_task();

	PRINTF("Processes running\n");

	OSSemBinaryCreate(0, &Contiki_Sem);

	PRINTF("\n*******%s online*******\n\r", CONTIKI_VERSION_STRING);

	while (1) {

		int n;

		do {
			n = process_run();
		} while (n > 0);

		OSSemPend(Contiki_Sem, 0);
	}
}
开发者ID:thiagohd,项目名称:BRTOSicslowpan,代码行数:41,代码来源:contiki-main.c

示例14: main

void main(void)
{
  disable_interrupt();
  
  clock_init();

  /* workaround to wait for LSM9DS0 ready */
  clock_delay_usec(60000);

  /* serial port */
  serial_init();

  /* one wire UART based LIN (ULIN) */
  ulin_init();

  /* real time timer */
  rtimer_init();

  /* radio configuration */
  rf_init(RADIO_CHANNEL);

  /* comment this line out to prevent bluetooth board from crashing */
  printf("\nSMAC2.0 - [%x:%x]\n", rf_get_short_addr1(), rf_get_short_addr0());
  
  enable_interrupt();

  /* module specific initialization - modules.h */
  module_init();

  /* flash bank used as storage */
  flash_bank_select(FLASH_BANK_7);

  /* looping services */
  while(1)
  {
    json_service();
    serial_service();
    ulin_service();
  }
}
开发者ID:SMACproject,项目名称:eSMAC-firmware,代码行数:40,代码来源:main.c

示例15: initialize

/*-----------------------------Low level initialization--------------------*/
static void initialize(void) {

  watchdog_init();
  watchdog_start();

#if CONFIG_STACK_MONITOR
  /* Simple stack pointer highwater monitor. The 'm' command in cdc_task.c
   * looks for the first overwritten magic number.
   */
{
extern uint16_t __bss_end;
uint16_t p=(uint16_t)&__bss_end;
    do {
      *(uint16_t *)p = 0x4242;
      p+=100;
    } while (p<SP-100); //don't overwrite our own stack
}
#endif

  /* Initialize hardware */
  // Checks for "finger", jumps to DFU if present.
  init_lowlevel();
  
  /* Clock */
  clock_init();

  /* Leds are referred to by number to prevent any possible confusion :) */
  /* Led0 Blue Led1 Red Led2 Green Led3 Yellow */
  Leds_init();
  Led1_on();

/* Get a random (or probably different) seed for the 802.15.4 packet sequence number.
 * Some layers will ignore duplicates found in a history (e.g. Contikimac)
 * causing the initial packets to be ignored after a short-cycle restart.
 */
  ADMUX =0x1E;              //Select AREF as reference, measure 1.1 volt bandgap reference.
  ADCSRA=1<<ADEN;           //Enable ADC, not free running, interrupt disabled, fastest clock
  ADCSRA|=1<<ADSC;          //Start conversion
  while (ADCSRA&(1<<ADSC)); //Wait till done
  PRINTD("ADC=%d\n",ADC);
  random_init(ADC);
  ADCSRA=0;                 //Disable ADC
  
#if USB_CONF_RS232
  /* Use rs232 port for serial out (tx, rx, gnd are the three pads behind jackdaw leds */
  rs232_init(RS232_PORT_0, USART_BAUD_57600,USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8);
  /* Redirect stdout to second port */
  rs232_redirect_stdout(RS232_PORT_0);
#if ANNOUNCE
  PRINTA("\n\n*******Booting %s*******\n",CONTIKI_VERSION_STRING);
#endif
#endif
	
  /* rtimer init needed for low power protocols */
  rtimer_init();

  /* Process subsystem. */
  process_init();

  /* etimer process must be started before USB or ctimer init */
  process_start(&etimer_process, NULL);

  Led2_on();
  /* Now we can start USB enumeration */
  process_start(&usb_process, NULL);

  /* Start CDC enumeration, bearing in mind that it may fail */
  /* Hopefully we'll get a stdout for startup messages, if we don't already */
#if USB_CONF_SERIAL
  process_start(&cdc_process, NULL);
{unsigned short i;
  for (i=0;i<65535;i++) {
    process_run();
    watchdog_periodic();
    if (stdout) break;
  }
#if !USB_CONF_RS232
  PRINTA("\n\n*******Booting %s*******\n",CONTIKI_VERSION_STRING);
#endif
}
#endif
  if (!stdout) Led3_on();
  
#if RF230BB
#if JACKDAW_CONF_USE_SETTINGS
  PRINTA("Settings manager will be used.\n");
#else
{uint8_t x[2];
	*(uint16_t *)x = eeprom_read_word((uint16_t *)&eemem_channel);
	if((uint8_t)x[0]!=(uint8_t)~x[1]) {
        PRINTA("Invalid EEPROM settings detected. Rewriting with default values.\n");
        get_channel_from_eeprom();
    }
}
#endif

  ctimer_init();
  /* Start radio and radio receive process */
  /* Note this starts RF230 process, so must be done after process_init */
//.........这里部分代码省略.........
开发者ID:1uk3,项目名称:contiki,代码行数:101,代码来源:contiki-raven-main.c


注:本文中的rtimer_init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。