hi!
I use S912ZVML32 to design can bus. With AN4975 routine,I define a struct in CAN_cfg.h, I include shree header "gflib.h""gmclib.h" "gdflib.h",I've seen other projects. They can be used in this way. but,Always report errors after compilation .
The contents are as follows :
//prevent multiple inclusion
#ifndef _CAN_CFG_H_
#define _CAN_CFG_H_
#include "gflib.h"
#include "gmclib.h"
#include "gdflib.h"
//define the CAN speed options (kbps)
#define CAN_125_KBPS 125
#define CAN_250_KBPS 250
#define CAN_500_KBPS 500
//pick the CAN bus speed that will be used
#define CAN_BAUDRATE CAN_250_KBPS
typedef struct
{
tFrac16 dbc_factor;
tS8 dbc_offset;
tS16 dbc_min;
tS16 dbc_max;
} can_rxdbc_t; //
//_CAN_CFG_H_
#endif
The error information is as follows
> C:\Freescale\AMMCLIB\MC9S12ZVM_AMMCLIB_v1.0.0\include\gflib.h:32
> C:\code\can_example\S12ZVM_CAN_Example\Project_Headers\CAN_cfg.h:5
> C:\code\can_example\S12ZVM_CAN_Example\Sources\CAN.c:7)
(C:\Freescale\AMMCLIB\MC9S12ZVM_AMMCLIB_v1.0.0\include\GFLIB_Atan.h|126|37|2|6649|2)
= #if (SWLIBS_DEFAULT_IMPLEMENTATION == SWLIBS_DEFAULT_IMPLEMENTATION_FLT)
>illegal token for integral constant expression
>(included from:
> C:\Freescale\AMMCLIB\MC9S12ZVM_AMMCLIB_v1.0.0\include\gflib.h:32
> C:\code\can_example\S12ZVM_CAN_Example\Project_Headers\CAN_cfg.h:5
> C:\code\can_example\S12ZVM_CAN_Example\Sources\CAN.c:7)
What's the problem? Who can help me? Thank you. !!
Hi,
check if you have correctly configured the following define in the file SWLIBS_Config.h:
#define SWLIBS_DEFAULT_IMPLEMENTATION <insert your choice of default implementation>
Refer to the section "Multiple Implementation Support" in the AMMCLib User's Guide for more info.
Regards,
Petr
Is it MC9S12ZVM_AMMCLIB setting error?