cancel
Showing results for 
Search instead for 
Did you mean: 

Does it wrong typdef constant select from comdef.h to main.c?

Md Mubdiul Hasan
Associate III
Posted on November 25, 2016 at 03:45

Dear Sir,

Take a look the global constant contained in comdef.h.

typedef  unsigned char      boolean;        /* Boolean value type. */

typedef  unsigned int       uint32;      /* Unsigned 32 bit value */

typedef  unsigned short     uint16;      /* Unsigned 16 bit value */

typedef  unsigned char      uint8;       /* Unsigned 8  bit value */

typedef  signed int         int32;       /* Signed 32 bit value */

typedef  signed short       int16;       /* Signed 16 bit value */

typedef  signed char        int8;        /* Signed 8  bit value */

typedef  float              FP32;        /* Single precision floating point */

typedef  double             FP64;        /* Double precision floating point */

typedef  unsigned char      bool;        /* Boolean value type. */

//typedef  unsigned int       uint32_t;      /* Unsigned 32 bit value */

//typedef  unsigned short     uint16_t;      /* Unsigned 16 bit value */

//typedef  unsigned char      uint8_t;       /* Unsigned 8  bit value */

//typedef  signed int         int32_t;       /* Signed 32 bit value */

//typedef  signed short       int16_t;       /* Signed 16 bit value */

//typedef  signed char        int8_t;        /* Signed 8  bit value */

Its clear from this section that, uint16_t; is kept inactive.

Now look at my Private variables called in C main,

uint16_t LED1_Status=0;

uint16_t LED2_Status=0;

uint16_t LED5_Status=0;

uint16_t LED6_Status=0;

Is it okay? Why then?

Regards

Hasan

11 REPLIES 11
Md Mubdiul Hasan
Associate III
Posted on November 30, 2016 at 02:34

''My degree is in Electrical and Electronic Engineering.''

 

It means you know circuits well and control things in your programming skills. 

Now-a-days all companies treated some one as Hardware Engineer who is expert in both. 

My passion and background is circuit analysis, PCB design and easy soldering stuffs in handmade pcbs!

For the case of survival, I saw companies offering position who knows embedded programming! 

 I  swallowed  stuffs what I dont want to eat! 

''There is a lot of material available, you'll need to find what suits your needs/experience.''

 

Yes I usually do,but drifting inside huge sea!

''Try to localize your use of comdef.h to places you actually need it, and understand what specific parts of it are required by your other code.''

 

I was trying to keep inactive/deactivate some trypedef data size variables/constant from comdef.h, and significantly built output changes.

Along with states, global files and utilities, its clear that constants from comdef are responsible for flowing data/buffersize to system functionality.

In general saying, how long your 7-segment will glow accordance with receive data, how long the buzzer will beeps, how long your press key should up/down temperature heat up reading?

From my little knowledge, some part of state files, utilities, key driver is not talking with HAL as it completely getting instruction from comdef.h. Most of the times, it says redefine, implicit, unresolved issues. 

 

''Your compiler command line still does not seem to be using the USE_HAL_DRIVER define, or one for the STM32F0xx part you are using.''

Yes, it might be. I did scanning from find in file/ syntax checking/static analysis.    #20: identifier ''HAL_LockTypeDef'' is undefined.

Most of the time there errors generates while,

compiling hs_key_handle.c...

compiling global.c...

compiling sevenseg_state.c...

compiling io_util.c...

So, these c files cant accepts HAL  may be.

I also check the error list says, 

redefinition of 't_50mg_flag witha different type bool. It comes from global.c.

''Review the setting in your CooCox project with some more rigour, and apply them to the Keil project. Review working HAL/CubeMX projects for your platform.

 

 Start with something simple so you don't get lost in the complexity.''

1. As code was build in Coo-cox  environment, I have modified some of its part after changing its main MCU pinout in cubemx.

2. What I have modified is, its tim.h. spi.h, gpio.h, files combine in one main.c file. Remove I2C h file. some time I did #include #define. 

3.  Make changes in mxconstant.h file, as we changes GPIO in cubemx.

Md Mubdiul Hasan
Associate III
Posted on December 01, 2016 at 02:01

Dear Sir Clive1,

In my push key state file included (from Coo-cox) signal.h and stdint.h that is not from ARMCC may be.

Take a look on search output,

Searching for 'signal.h'...

C:\MDK5-projects\rc_2016\key driver\hs_key_handle.c(25) : //#include ''signal.h''

Lines matched: 1      Files matched: 1      Total files searched: 80

 ARMCC dont have such file in MDK.

Regarding ''comdef.h'' I can also only say, this file belongs to Visual Studio. Most likely non of the files from MDK-ARM nor CubeMX refer to this file