Changeset 268


Ignore:
Timestamp:
09/29/2007 10:23:59 AM (4 years ago)
Author:
hsinmu
Message:

updated printf example

Location:
nano-RK/projects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nano-RK/projects/basic_tasks/main.c

    r265 r268  
    8181uint16_t cnt; 
    8282 
    83 printf( "My node's address is %d\r\n",NODE_ADDR ); 
    84  
    85   printf( "Task1 PID=%d\r\n",nrk_get_pid()); 
    86   cnt=0; 
     83printf( "My node's address is %u\r\n",NODE_ADDR ); 
     84   
     85printf( "Task1 PID=%u\r\n",nrk_get_pid()); 
    8786  while(1) { 
    8887        nrk_led_toggle(ORANGE_LED); 
    8988        nrk_gpio_toggle(NRK_DEBUG_0); 
    90         printf( "Task1 cnt=%d\r\n",cnt ); 
     89        printf( "Task1 cnt=%u\r\n",cnt ); 
    9190        nrk_wait_until_next_period(); 
    9291        // Uncomment this line to cause a stack overflow 
     
    9897void Task2() 
    9998{ 
    100   uint8_t cnt; 
    101   printf( "Task2 PID=%d\r\n",nrk_get_pid()); 
     99  int16_t cnt; 
     100  printf( "Task2 PID=%u\r\n",nrk_get_pid()); 
    102101  cnt=0; 
    103102  while(1) { 
    104103        nrk_led_toggle(BLUE_LED); 
    105104        nrk_gpio_toggle(NRK_DEBUG_1); 
    106         printf( "Task2 cnt=%d\r\n",cnt ); 
    107         nrk_wait_until_next_period(); 
    108         cnt++; 
     105        printf( "Task2 signed cnt=%d\r\n",cnt ); 
     106        nrk_wait_until_next_period(); 
     107        cnt--; 
    109108        } 
    110109} 
     
    114113uint16_t cnt; 
    115114uint16_t i; 
    116   printf( "Task3 PID=%d\r\n",nrk_get_pid()); 
     115  printf( "Task3 PID=%u\r\n",nrk_get_pid()); 
    117116  cnt=0; 
    118117  while(1) { 
    119118        nrk_led_toggle(GREEN_LED); 
    120119        nrk_gpio_toggle(NRK_DEBUG_2); 
    121         printf( "Task3 cnt=%d\r\n",cnt ); 
     120        printf( "Task3 cnt=%u\r\n",cnt ); 
    122121        nrk_wait_until_next_period(); 
    123122        cnt++; 
     
    129128uint16_t cnt; 
    130129 
    131   printf( "Task4 PID=%d\r\n",nrk_get_pid()); 
     130  printf( "Task4 PID=%u\r\n",nrk_get_pid()); 
    132131  cnt=0; 
    133132  while(1) { 
    134133        nrk_led_toggle(RED_LED); 
    135134        nrk_gpio_toggle(NRK_DEBUG_3); 
    136         printf( "Task4 cnt=%d\r\n",cnt ); 
     135        printf( "Task4 cnt=%u\r\n",cnt ); 
    137136        nrk_wait_until_next_period(); 
    138137        cnt++; 
  • nano-RK/projects/self_test/makefile

    r258 r268  
    11# Platform name  cc2420DK, firefly, micaZ 
    2 PLATFORM = firefly2_2 
     2PLATFORM = micaZ 
    33 
    44 
     
    77 
    88# Set the Port that you programmer is connected to  
    9 PROGRAMMING_PORT = /dev/ttyUSB1 # Default FireFly port  
    10 # PROGRAMMING_PORT = /dev/ttyUSB0 # Default micaZ port  
     9# PROGRAMMING_PORT = /dev/ttyUSB1 # Default FireFly port  
     10 PROGRAMMING_PORT = /dev/ttyUSB0 # Default micaZ port  
    1111 
    1212# Set this such that the nano-RK directory is the base path 
Note: See TracChangeset for help on using the changeset viewer.