Skip to content

Commit

Permalink
update all examples to support SDCC 4.2.11 breaking change of renamin…
Browse files Browse the repository at this point in the history
…g _sdcc_external_startup() to __sdcc_external_startup()
  • Loading branch information
freepdk committed Feb 4, 2023
1 parent ccf5b57 commit 5b752dc
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Examples/src/adctest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Examples/src/calib-and-fuse-demo.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdint.h>
#include "easypdk/pdk.h"

unsigned char _sdcc_external_startup(void)
unsigned char __sdcc_external_startup(void)
{
//
// F U S E S
Expand All @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion Examples/src/comptest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Examples/src/easypdk/pdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Examples/src/helloworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Examples/src/helloworld_2cores.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Examples/src/helloworld_2mhz.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b752dc

Please sign in to comment.