diff --git a/Examples/src/adctest.c b/Examples/src/adctest.c index 6d0f0c9..9bc5e88 100644 --- a/Examples/src/adctest.c +++ b/Examples/src/adctest.c @@ -31,7 +31,7 @@ int putchar(int c) return (c); } -unsigned char _sdcc_external_startup(void) +unsigned char __sdcc_external_startup(void) { EASY_PDK_INIT_SYSCLOCK_8MHZ(); //use 8MHz sysclock EASY_PDK_USE_FACTORY_IHRCR_16MHZ() //use factory IHCR tuning value (tuned for 8MHz SYSCLK @ 5.0V) diff --git a/Examples/src/calib-and-fuse-demo.c b/Examples/src/calib-and-fuse-demo.c index 0e7acd0..dd02d72 100644 --- a/Examples/src/calib-and-fuse-demo.c +++ b/Examples/src/calib-and-fuse-demo.c @@ -1,7 +1,7 @@ #include #include "easypdk/pdk.h" -unsigned char _sdcc_external_startup(void) +unsigned char __sdcc_external_startup(void) { // // F U S E S @@ -16,7 +16,7 @@ unsigned char _sdcc_external_startup(void) // // C A L I B R A T I O N S // - // Calibrations should always be inserted in "_sdcc_external_startup()" function to ensure reachability at startup. + // Calibrations should always be inserted in "__sdcc_external_startup()" function to ensure reachability at startup. // // SYSCLK setup and calibration (Your application should use only one of the IHRC and/or ILRC setup and claibrations). diff --git a/Examples/src/comptest.c b/Examples/src/comptest.c index c49803f..d35e18a 100644 --- a/Examples/src/comptest.c +++ b/Examples/src/comptest.c @@ -37,7 +37,7 @@ int putchar(int c) return (c); } -unsigned char _sdcc_external_startup(void) +unsigned char __sdcc_external_startup(void) { EASY_PDK_INIT_SYSCLOCK_1MHZ(); //use 1MHz sysclock EASY_PDK_CALIBRATE_IHRC(1000000,5000); //tune SYSCLK to 1MHz @ 5.000V diff --git a/Examples/src/easypdk/pdk.h b/Examples/src/easypdk/pdk.h index 4e5b494..90fa17d 100644 --- a/Examples/src/easypdk/pdk.h +++ b/Examples/src/easypdk/pdk.h @@ -6,6 +6,10 @@ #error "SDCC 4.1.10 or newer is required" #endif +#if(!(__SDCC_VER>=40211)) +#define __sdcc_external_startup _sdcc_external_startup +#endif + #if defined(PMS150C) #include "pms150c.h" #elif defined(PMS150G) diff --git a/Examples/src/helloworld.c b/Examples/src/helloworld.c index fa74eea..4d9b1d4 100644 --- a/Examples/src/helloworld.c +++ b/Examples/src/helloworld.c @@ -31,7 +31,7 @@ int putchar(int c) return (c); } -unsigned char _sdcc_external_startup(void) +unsigned char __sdcc_external_startup(void) { EASY_PDK_INIT_SYSCLOCK_8MHZ(); //use 8MHz sysclock EASY_PDK_CALIBRATE_IHRC(8000000,4000); //tune SYSCLK to 8MHz @ 4.000V diff --git a/Examples/src/helloworld_2cores.c b/Examples/src/helloworld_2cores.c index f14ea14..675f85a 100644 --- a/Examples/src/helloworld_2cores.c +++ b/Examples/src/helloworld_2cores.c @@ -19,7 +19,7 @@ __asm__(" \n\ add a, #l_OSEG + 1 \n\ and a, #0xfe \n\ mov.io sp, a \n\ - call __sdcc_external_startup \n\ + call ___sdcc_external_startup \n\ goto s_GSINIT \n\ .area CODE \n"); } @@ -51,7 +51,7 @@ int putchar(int c) return (c); } -unsigned char _sdcc_external_startup(void) +unsigned char __sdcc_external_startup(void) { EASY_PDK_INIT_SYSCLOCK_8MHZ(); //use 8MHz sysclock // EASY_PDK_USE_FACTORY_IHRCR_16MHZ(); diff --git a/Examples/src/helloworld_2mhz.c b/Examples/src/helloworld_2mhz.c index 9f7d117..da6c62d 100644 --- a/Examples/src/helloworld_2mhz.c +++ b/Examples/src/helloworld_2mhz.c @@ -31,7 +31,7 @@ int putchar(int c) return (c); } -unsigned char _sdcc_external_startup(void) +unsigned char __sdcc_external_startup(void) { EASY_PDK_INIT_SYSCLOCK_2MHZ(); //use 2MHz sysclock EASY_PDK_CALIBRATE_IHRC(2000000,4000); //tune SYSCLK to 2MHz @ 4.000V