gcc和mdk都能编译成功

This commit is contained in:
andy
2023-11-01 23:51:19 +08:00
parent ddeec88a89
commit 17729e664f
17 changed files with 563 additions and 27 deletions

View File

@@ -238,4 +238,6 @@
2023.11.1
使用make -f Makeboot 来使用gcc编译
添加 DMod_FireBusReadDatasV2_RC 函数
2023.11.1
make 对文件名是区分大小写的...

View File

@@ -72,7 +72,7 @@ uint32_t atoi32(const char* str,uint16_t base)
*@param n:src num str[5]:string buffer lenstring size
*@return void
*/
void itoa(uint16_t n,uint8_t str[5], uint8_t len)
void myitoa(int n,char *str, int len)
{
uint8_t i=len-1;

View File

@@ -7,7 +7,7 @@
float myatof(const char* str);
uint16_t atoi16(const char* str,uint16_t base); /* Convert a string to integer number */
uint32_t atoi32(const char* str,uint16_t base); /* Convert a string to integer number */
void itoa(uint16_t n,uint8_t* str, uint8_t len);
void myitoa(int n,char* str, int len);
int validatoi(const char* str, int base, uint32_t* ret); /* Verify character string and Convert it to (hexa-)decimal. */
char c2d(uint8_t c);
char d2c(uint8_t c);

View File

@@ -40,9 +40,9 @@ typedef struct{
static self_def g_self;
int elec_check_scheme(void);
void elec_load_scheme(void);
int elec_parper_power(void);
static int elec_check_scheme(void);
static void elec_load_scheme(void);
static int elec_parper_power(void);
// 初始化

View File

@@ -6,7 +6,7 @@
#define BUILD_DATE "2023-11-01 16:33:25"
#define BUILD_DATE "2023-11-01 23:50:38"
#define SOFT_VERSION "2.03"

View File

@@ -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++)
{

View File

@@ -37,13 +37,13 @@ int signal_init(void)
static void cpy4byte(uint32_t *dst,uint32_t *src,int num_4byte)
{
for(int i=0;i<num_4byte;i++)
{
dst[i]=src[i];
}
}
// static void cpy4byte(uint32_t *dst,uint32_t *src,int num_4byte)
// {
// for(int i=0;i<num_4byte;i++)
// {
// dst[i]=src[i];
// }
// }
@@ -235,10 +235,17 @@ int disconnect_slot(void *slot_obj)
signal_def *signal_find(void *signal_)
{
#if defined (__CC_ARM)
extern const int signalstruct$$Base;
extern const int signalstruct$$Limit;
signal_def *start=(signal_def *)&signalstruct$$Base;
signal_def *end=(signal_def *)&signalstruct$$Limit;
#else
extern const int __start_signalstruct;
extern const int __stop_signalstruct;
signal_def *start=(signal_def *)&__start_signalstruct;
signal_def *end=(signal_def *)&__stop_signalstruct;
#endif
for(signal_def *t=start;t<end;t++)
{
if(t->signal_==signal_)

View File

@@ -23,10 +23,17 @@ void *tappend(void *p,void *del);
static commend_def *cmd_find(char *name)
{
#if defined (__CC_ARM)
extern const int cmdstruct$$Base;
extern const int cmdstruct$$Limit;
commend_def *start=(commend_def *)&cmdstruct$$Base;
commend_def *end=(commend_def *)&cmdstruct$$Limit;
#else
extern const int __start_cmdstruct;
extern const int __stop_cmdstruct;
commend_def *start=(commend_def *)&__start_cmdstruct;
commend_def *end=(commend_def *)&__stop_cmdstruct;
#endif
for(commend_def *t=start;t<end;t++)
{
if(strcmp(t->name,name)==0)
@@ -114,10 +121,17 @@ int cmd_printf(const char *fmt,...)
static int cmd_help(list_def *argv)
{
#if defined (__CC_ARM)
extern const int cmdstruct$$Base;
extern const int cmdstruct$$Limit;
commend_def *start=(commend_def *)&cmdstruct$$Base;
commend_def *end=(commend_def *)&cmdstruct$$Limit;
#else
extern const int __start_cmdstruct;
extern const int __stop_cmdstruct;
commend_def *start=(commend_def *)&__start_cmdstruct;
commend_def *end=(commend_def *)&__stop_cmdstruct;
#endif
cmd_print("help ->");
for(commend_def *t=start;t<end;t++)
{

View File

@@ -135,10 +135,17 @@ static array_def *protu_try_decode(protu_def *p,array_def *data)
(decode_data=p->codec->decode(p,data),strcmp(p->str_err,"ok")!=0))
{
CHECK_DO(decode_data,arr_delete);
#if defined (__CC_ARM)
extern const int codecstruct$$Base;
extern const int codecstruct$$Limit;
codec_item *start=(codec_item *)&codecstruct$$Base;
codec_item *end=(codec_item *)&codecstruct$$Limit;
#else
extern const int __start_codecstruct;
extern const int __stop_codecstruct;
codec_item *start=(codec_item *)&__start_codecstruct;
codec_item *end=(codec_item *)&__stop_codecstruct;
#endif
for(codec_item *t=start;t<end;t++)
{
decode_data=t->decode(p,data);

View File

@@ -124,10 +124,17 @@ int tran_get_busy(tran_def *t)
static ucport_item *cmd_find(const char *codec_name,uint8_t cmd)
{
#if defined (__CC_ARM)
extern const int transtruct$$Base;
extern const int transtruct$$Limit;
ucport_item *start=(ucport_item *)&transtruct$$Base;
ucport_item *end=(ucport_item *)&transtruct$$Limit;
#else
extern const int __start_transtruct;
extern const int __stop_transtruct;
ucport_item *start=(ucport_item *)&__start_transtruct;
ucport_item *end=(ucport_item *)&__stop_transtruct;
#endif
for(ucport_item *t=start;t<end;t++)
{
if((t->cmd==cmd)&&(strcmp(t->codec_name,codec_name)==0))