Forum : ST7/STM8
Original Post
Post Information | Post |
---|---|
February 2, 2012 - 9:08pm
|
Hi, Perhaps this is an simple mistake on my side but i cannot get the compliler to compile this header file: /*rfm12 driver*/ #ifndef __RFM12_DRV_H #define __RFM12_DRV_H /* Includes ------------------------------------------------------------------*/ #include "stm8l10x.h" #define MAX_TRANSMIT_BUFFER_LENGTH (32) #define MAX_RECEIVE_BUFFER_LENGTH (32) typedef struct { uint8_t length; uint8_t data[MAX_TRANSMIT_BUFFER_LENGTH]; } t_transmit_buffer; typedef struct { uint8_t length; uint8_t data[MAX_RECEIVE_BUFFER_LENGTH]; } t_receive_buffer; void rfm12_init(void); void rfm12_transmit(transmit_buffer* trans_data); void rfm12_receive(receive_buffer* rec data); #endif /*__RFM12_DRV_H*/ It looks fine to me, but i keep on gettting this set of errors: *** ERROR C000 IN LINE 11 OF ..\..\/rfm12_drv.h : Character '}' missing *** ERROR C131 IN LINE 13 OF ..\..\/rfm12_drv.h : unbalanced #if-endif controls What may be the reason for theese errors? |
Hi Pawel,
You have this problem because you use the uint8_t type, which is not defined.
You must ensure (perhaps in your stm8l10x.h file) that it is properly defined, for example :
Best Regards,
Hi Bruno,
Thanks for your answer. I have double checked the typedefs. They are included in the stm8l10x.h. Can you think of any other reason for this error?
BR,
Pawel
Hi Pawel,
I missed this one : You are using "data" as a struct member name. However, it is a reszerved keyword on RCSTM8 (indicates that a variable should be located in a 16-bit space).
=> Change "data" to "_data" (or anything else) and it should be ok.
Best Regards,
Thanks Bruno,
I will check that.