1 /* procesor H8S/2638 ver 1.1 */
5 //#include <periph/chmod_lcd.h>
6 //#include <periph/sgm_lcd.h>
7 #include <system_def.h>
12 #define DEB_LED_INIT()
13 #define DEB_LED_OFF(num)
14 #define DEB_LED_ON(num)
18 #define APPLICATION_START
20 /*#define USE_FONT_6x8*/
23 #define HIT_LOAD_BAUD 0
26 /* hack for start of main, should use crt0.o instead */
27 /* Used in boot mode to start main(). */
28 __asm__ /*__volatile__*/(
29 ".global _start_hack\n\t"
31 "mov.l #0xffdffe,sp\n\t"
41 void deb_wr_hex(long hex, short digs);
43 char data_test[]={'D','A','T','A',0};
46 *----------------------------------------------------------
48 void deb_wr_hex(long hex, short digs)
52 c=((hex>>(4*digs))&0xf)+'0';
53 if(c>'9') c+='A'-'9'-1;
57 static void deb_led_out(char val)
84 /*set power on for SCI0 and SCI1 module*/
85 *SYS_MSTPCRB&=~MSTPCRB_SCI0m;
86 *SYS_MSTPCRB&=~MSTPCRB_SCI1m;
89 SCIInit(HIT_LOAD_BAUD);
97 /* switch off SCI2 module*/
98 *SYS_MSTPCRB|=MSTPCRB_SCI2m;
105 bauddet=SCIAutoBaud();
106 deb_wr_hex(bauddet,4);
110 ProgMode(HIT_LOAD_BAUD);
113 #endif /* BOOT_TEST */
115 inline int call_address(unsigned long addr)
117 typedef int (*my_call_t)(void);
118 my_call_t my_call=(my_call_t)addr;
123 *-----------------------------------------------------------
127 /* Only for debuging */
128 void deb_led_blink() {
141 _setup_board(); /* Provided in bspbase library of each board */
143 p=(__u8*)&deb_wr_hex;
144 if(p>=IRAM_START) p=" IRAM";
146 else if(p>=SRAM_START) p=" SRAM";
149 else if(p>=XRAM_START) p=" XRAM";
151 else if(p>(__u8*)0x4000l) p=" FLSHU";
155 #if 0 /* FLASH timing test */
168 #ifdef APPLICATION_START
169 if(((*FLM_FLMCR1) & FLMCR1_FWEm)==0) {
170 if (*((unsigned long *)0x4000)!=0xffffffff){
171 call_address(0x4000);
174 #endif /* APPLICATION_START */
182 #endif /* BOOT_TEST */