Mercurial > flash_v2
comparison packages/hal/common/current/src/hal_if.c @ 110:84e4bde58b26 ecos-sw-2000-07-14
Merge from eCos master repository on 2000-07-14-22:00:02-BST
| author | jlarmour |
|---|---|
| date | Mon, 17 Jul 2000 14:42:27 +0000 |
| parents | 7f461c3a372c |
| children | 02ea4320376c |
comparison
equal
deleted
inserted
replaced
| 109:5720c4b6e1d2 | 110:84e4bde58b26 |
|---|---|
| 102 // been stalling us for some time. | 102 // been stalling us for some time. |
| 103 usec_ticks -= elapsed; | 103 usec_ticks -= elapsed; |
| 104 } while (usec_ticks > 0); | 104 } while (usec_ticks > 0); |
| 105 | 105 |
| 106 CYGARC_HAL_RESTORE_GP(); | 106 CYGARC_HAL_RESTORE_GP(); |
| 107 #else | |
| 108 // Use a HAL feature if defined | |
| 109 #ifdef HAL_DELAY_US | |
| 110 HAL_DELAY_US(usecs); | |
| 111 #endif | |
| 107 #endif | 112 #endif |
| 108 } | 113 } |
| 109 | 114 |
| 110 static void | 115 static void |
| 111 reset(void) | 116 reset(void) |
| 362 struct Hal_SavedRegisters *hal_saved_interrupt_state; | 367 struct Hal_SavedRegisters *hal_saved_interrupt_state; |
| 363 | 368 |
| 364 void | 369 void |
| 365 hal_ctrlc_isr_init(void) | 370 hal_ctrlc_isr_init(void) |
| 366 { | 371 { |
| 372 // A ROM monitor never enables the interrupt itself. This is left | |
| 373 // to the (RAM) application. | |
| 374 #ifndef CYGSEM_HAL_ROM_MONITOR | |
| 367 hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_DEBUG_PROCS(); | 375 hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_DEBUG_PROCS(); |
| 368 | 376 |
| 369 #if 1 // Prevents crash on older stubs | 377 #if 1 // Prevents crash on older stubs |
| 370 if (CYGNUM_CALL_IF_TABLE_VERSION != CYGACC_CALL_IF_VERSION()) | 378 if (CYGNUM_CALL_IF_TABLE_VERSION != CYGACC_CALL_IF_VERSION()) |
| 371 return; | 379 return; |
| 380 | |
| 381 // Now trash that value - otherwise downloading an image with | |
| 382 // builtin stubs on a board with older stubs may cause all | |
| 383 // subsequent runs to (wrongly) fall through to the below code. | |
| 384 // If there is a new stub on the board, it will reinitialize the | |
| 385 // version field on reset. | |
| 386 // Yes, this is a gross hack! | |
| 387 CYGACC_CALL_IF_VERSION_SET(CYGNUM_CALL_IF_TABLE_VERSION+1); | |
| 372 #endif | 388 #endif |
| 373 | 389 |
| 374 CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_IRQ_ENABLE); | 390 CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_IRQ_ENABLE); |
| 391 #endif | |
| 375 } | 392 } |
| 376 | 393 |
| 377 cyg_uint32 | 394 cyg_uint32 |
| 378 hal_ctrlc_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) | 395 hal_ctrlc_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) |
| 379 { | 396 { |
