comparison packages/hal/common/current/src/hal_stub.c @ 76:435cced73e2f ecos-v1_3_1-release

eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
author jlarmour
date Tue, 28 Mar 2000 14:10:45 +0000
parents c5536bad4c24
children c37d3a9e1b28
comparison
equal deleted inserted replaced
75:41bf073c0c32 76:435cced73e2f
92 _registers[which] = value; 92 _registers[which] = value;
93 } 93 }
94 94
95 //----------------------------------------------------------------------------- 95 //-----------------------------------------------------------------------------
96 // Serial stuff 96 // Serial stuff
97 #ifdef CYGPKG_CYGMON
98 extern void ecos_bsp_console_putc(char);
99 extern char ecos_bsp_console_getc(void);
100 #endif
97 101
98 // Write C to the current serial port. 102 // Write C to the current serial port.
99 void 103 void
100 putDebugChar (int c) 104 putDebugChar (int c)
101 { 105 {
106 #ifdef CYGPKG_CYGMON
107 ecos_bsp_console_putc(c);
108 #else
102 HAL_STUB_PLATFORM_PUT_CHAR(c); 109 HAL_STUB_PLATFORM_PUT_CHAR(c);
110 #endif
103 } 111 }
104 112
105 // Read one character from the current serial port. 113 // Read one character from the current serial port.
106 int 114 int
107 getDebugChar (void) 115 getDebugChar (void)
108 { 116 {
117 #ifdef CYGPKG_CYGMON
118 return ecos_bsp_console_getc();
119 #else
109 return HAL_STUB_PLATFORM_GET_CHAR(); 120 return HAL_STUB_PLATFORM_GET_CHAR();
121 #endif
110 } 122 }
111 123
112 // Set the baud rate for the current serial port. 124 // Set the baud rate for the current serial port.
113 void 125 void
114 __set_baud_rate (int baud) 126 __set_baud_rate (int baud)
115 { 127 {
128 #ifdef CYGPKG_CYGMON
129 // FIXME!
130 #else
116 HAL_STUB_PLATFORM_SET_BAUD_RATE(baud); 131 HAL_STUB_PLATFORM_SET_BAUD_RATE(baud);
132 #endif
117 } 133 }
118 134
119 //----------------------------------------------------------------------------- 135 //-----------------------------------------------------------------------------
120 // GDB interrupt (BREAK) support. 136 // GDB interrupt (BREAK) support.
121 137
122 #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT 138 #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
123 139
140 #ifndef CYGPKG_HAL_ARM
124 141
125 #if (HAL_BREAKINST_SIZE == 1) 142 #if (HAL_BREAKINST_SIZE == 1)
126 typedef cyg_uint8 t_inst; 143 typedef cyg_uint8 t_inst;
127 #elif (HAL_BREAKINST_SIZE == 2) 144 #elif (HAL_BREAKINST_SIZE == 2)
128 typedef cyg_uint16 t_inst; 145 typedef cyg_uint16 t_inst;
191 return 1; 208 return 1;
192 } 209 }
193 return 0; 210 return 0;
194 } 211 }
195 212
213 #endif // CYGPKG_HAL_ARM
196 214
197 #endif // CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT 215 #endif // CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
198 216
199 // Use this function to disable serial interrupts whenever reply 217 // Use this function to disable serial interrupts whenever reply
200 // characters are expected from GDB. The reason we want to control 218 // characters are expected from GDB. The reason we want to control
321 static int initialized = 0; 339 static int initialized = 0;
322 340
323 if (!initialized) { 341 if (!initialized) {
324 initialized = 1; 342 initialized = 1;
325 343
344 #if !defined(CYGPKG_CYGMON)
326 #ifdef HAL_STUB_PLATFORM_INIT 345 #ifdef HAL_STUB_PLATFORM_INIT
327 // If the platform defines any initialization code, call it here. 346 // If the platform defines any initialization code, call it here.
328 HAL_STUB_PLATFORM_INIT(); 347 HAL_STUB_PLATFORM_INIT();
329 #endif 348 #endif
330 349
333 352
334 #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT 353 #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
335 // Get interrupt handler initialized. 354 // Get interrupt handler initialized.
336 HAL_STUB_PLATFORM_INIT_BREAK_IRQ(); 355 HAL_STUB_PLATFORM_INIT_BREAK_IRQ();
337 #endif 356 #endif
357 #endif // CYGPKG_CYGMON
338 } 358 }
339 } 359 }
340 360
341 // Reset the board. 361 // Reset the board.
342 void 362 void
343 __reset (void) 363 __reset (void)
344 { 364 {
365 #if !defined(CYGPKG_CYGMON)
345 HAL_STUB_PLATFORM_RESET(); 366 HAL_STUB_PLATFORM_RESET();
367 #endif
346 } 368 }
347 369
348 //----------------------------------------------------------------------------- 370 //-----------------------------------------------------------------------------
349 // Breakpoint support. 371 // Breakpoint support.
350 372