@@ -217,7 +217,9 @@ defined (STM8L05X_LD_VL) || defined (STM8L05X_MD_VL) || defined (STM8AL31_L_MD)
217217#define __I volatile const /*!< defines 'read only' permissions */
218218#define __O volatile /*!< defines 'write only' permissions */
219219#define __IO volatile /*!< defines 'read / write' permissions */
220-
220+ #if defined(__ICCSTM8__ ) || defined(__CSMC__ )
221+ #include <stdint.h>
222+ #else
221223/*!< Signed integer types */
222224typedef signed char int8_t ;
223225typedef signed short int16_t ;
@@ -238,9 +240,10 @@ typedef uint32_t u32;
238240typedef uint16_t u16 ;
239241typedef uint8_t u8 ;
240242
241-
242- typedef enum {FALSE = 0 , TRUE = !FALSE} bool ;
243-
243+ #ifdef __cplusplus
244+ typedef enum {FALSE = 0 , TRUE = !FALSE} bool ;
245+ #endif
246+ #endif
244247typedef enum {RESET = 0 , SET = !RESET } FlagStatus , ITStatus , BitStatus , BitAction ;
245248
246249typedef enum {DISABLE = 0 , ENABLE = !DISABLE } FunctionalState ;
@@ -2936,8 +2939,13 @@ AES_TypeDef;
29362939/*============================== Interrupt vector Handling ========================*/
29372940
29382941#ifdef _COSMIC_
2939- #define INTERRUPT_HANDLER (a ,b ) @far @interrupt void a(void)
2940- #define INTERRUPT_HANDLER_TRAP (a ) void @far @interrupt a(void)
2942+ #ifdef __cplusplus
2943+ #define INTERRUPT_HANDLER (a ,b ) void a(void)
2944+ #define INTERRUPT_HANDLER_TRAP (a ) void a(void)
2945+ #else
2946+ #define INTERRUPT_HANDLER (a ,b ) @interrupt @svlreg void a(void)
2947+ #define INTERRUPT_HANDLER_TRAP (a ) @interrupt void a(void)
2948+ #endif
29412949#endif /* _COSMIC_ */
29422950
29432951#ifdef _RAISONANCE_
@@ -2958,7 +2966,11 @@ AES_TypeDef;
29582966
29592967/*============================== Interrupt Handler declaration ========================*/
29602968#ifdef _COSMIC_
2961- #define INTERRUPT @far @interrupt
2969+ #ifdef __cplusplus
2970+ #define INTERRUPT
2971+ #else
2972+ #define INTERRUPT @interrupt
2973+ #endif
29622974#elif defined(_IAR_ )
29632975 #define INTERRUPT __interrupt
29642976#endif /* _COSMIC_ */
@@ -2993,6 +3005,7 @@ Comments : The different parameters of commands are
29933005#define BYTE_2 (n ) ((uint8_t)(BYTE_0((n) >> (uint8_t)16))) /*!< Returns the third byte of the 32-bit value */
29943006#define BYTE_3 (n ) ((uint8_t)(BYTE_0((n) >> (uint8_t)24))) /*!< Returns the high byte of the 32-bit value */
29953007
3008+ #define UNUSED (x ) ((void)(x))
29963009/*============================== Assert Macros ====================================*/
29973010#define IS_STATE_VALUE (STATE ) \
29983011 (((STATE) == SET) || \
0 commit comments