gcc和mdk都能编译成功
This commit is contained in:
@@ -79,10 +79,17 @@ void SysTick_Handler(void)
|
||||
|
||||
void *dev_get(const char *name)
|
||||
{
|
||||
#if defined (__CC_ARM)
|
||||
extern const int devstruct$$Base;
|
||||
extern const int devstruct$$Limit;
|
||||
struct dev_struct *start=(struct dev_struct *)&devstruct$$Base;
|
||||
struct dev_struct *end=(struct dev_struct *)&devstruct$$Limit;
|
||||
#elif defined (__GNUC__)
|
||||
extern const int __start_devstruct;
|
||||
extern const int __stop_devstruct;
|
||||
struct dev_struct *start=(struct dev_struct *)&__start_devstruct;
|
||||
struct dev_struct *end=(struct dev_struct *)&__stop_devstruct;
|
||||
#endif
|
||||
for(struct dev_struct *t=start;t<end;t++)
|
||||
{
|
||||
if(strcmp(t->name,name)==0)
|
||||
@@ -109,10 +116,17 @@ void param_err_handle(const char *param,const char *file,const char *fun,int lin
|
||||
|
||||
void app_init(void)
|
||||
{
|
||||
#if defined (__CC_ARM)
|
||||
extern const int initstruct$$Base;
|
||||
extern const int initstruct$$Limit;
|
||||
struct init_struct *start=(struct init_struct *)&initstruct$$Base;
|
||||
struct init_struct *end=(struct init_struct *)&initstruct$$Limit;
|
||||
#elif defined (__GNUC__)
|
||||
extern const int __start_initstruct;
|
||||
extern const int __stop_initstruct;
|
||||
struct init_struct *start=(struct init_struct *)&__start_initstruct;
|
||||
struct init_struct *end=(struct init_struct *)&__stop_initstruct;
|
||||
#endif
|
||||
int ret=0;
|
||||
for(struct init_struct *t=start;t<end;t++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user