Changeset 540

Show
Ignore:
Timestamp:
04/24/08 20:09:54 (3 weeks ago)
Author:
agr
Message:

sampl

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nano-RK/projects/SAMPL/client/nrk_cfg.h

    r537 r540  
    1313// #define NRK_HALT_ON_ERROR 
    1414//#define NRK_HALT_AND_LOOP_ON_ERROR 
     15#define NRK_REBOOT_ON_ERROR 
     16 
     17 
    1518#define NRK_WATCHDOG 
    1619// NRK_STACK_CHECK adds a little check to see if the bottom of the stack 
  • nano-RK/projects/SAMPL/gateway/nrk_cfg.h

    r354 r540  
    88// NRK_REPORT_ERRORS will cause the kernel to print out information about 
    99// missed deadlines or reserve violations 
    10 #define NRK_REPORT_ERRORS 
     10//#define NRK_REPORT_ERRORS 
    1111// NRK_HALT_ON_ERRORS will cause the kernel to freeze on errors so that 
    1212// it is easier to see debugging messages. 
    1313// #define NRK_HALT_ON_ERROR 
    1414//#define NRK_HALT_AND_LOOP_ON_ERROR 
     15 
     16#define NRK_REBOOT_ON_ERROR 
    1517 
    1618#define NRK_WATCHDOG 
  • nano-RK/src/kernel/source/nrk.c

    r431 r540  
    7171{ 
    7272         
    73     int i;     
     73    uint8_t i;         
    7474//    unsigned char *stkc; 
    7575         
     
    8282   #ifdef NRK_STARTUP_VOLTAGE_CHECK 
    8383        if(nrk_voltage_status()==0) nrk_kernel_error_add(NRK_LOW_VOLTAGE,0); 
     84   #endif 
     85 
     86   #ifdef NRK_REBOOT_ON_ERROR 
     87   #ifndef NRK_WATCHDOG 
     88   while(1) 
     89           { 
     90                nrk_kprintf( PSTR("KERNEL CONFIG CONFLICT:  NRK_REBOOT_ON_ERROR needs watchdog!\r\n") ); 
     91                for (i = 0; i < 100; i++) 
     92                        nrk_spin_wait_us (1000); 
     93           } 
     94   #endif 
    8495   #endif 
    8596 
  • nano-RK/src/kernel/source/nrk_error.c

    r412 r540  
    7878  if (error_num == 0) 
    7979    return 0; 
    80    
     80  
     81#ifndef NRK_REBOOT_ON_ERROR 
    8182   #ifdef NRK_HALT_ON_ERROR 
    8283   nrk_int_disable (); 
     
    8485   nrk_watchdog_disable(); 
    8586   #endif 
    86    
    87 #endif /*  */ 
    88      
     87  #endif  
     88#endif  
     89 
    8990#ifdef NRK_HALT_AND_LOOP_ON_ERROR  
    9091    nrk_int_disable (); 
     
    170171    putchar ('\r'); 
    171172    putchar ('\n'); 
    172      
     173 
     174#ifdef NRK_REBOOT_ON_ERROR 
     175  // wait for watchdog to kick in 
     176  nrk_int_enable();  
     177  while(1); 
     178#endif 
     179 
    173180//t=error_num; 
    174181#ifdef NRK_HALT_AND_LOOP_ON_ERROR