@@ -217,7 +217,9 @@ defined (STM8L05X_LD_VL) || defined (STM8L05X_MD_VL) || defined (STM8AL31_L_MD)
217
217
#define __I volatile const /*!< defines 'read only' permissions */
218
218
#define __O volatile /*!< defines 'write only' permissions */
219
219
#define __IO volatile /*!< defines 'read / write' permissions */
220
-
220
+ #if defined(__ICCSTM8__ ) || defined(__CSMC__ )
221
+ #include <stdint.h>
222
+ #else
221
223
/*!< Signed integer types */
222
224
typedef signed char int8_t ;
223
225
typedef signed short int16_t ;
@@ -238,9 +240,10 @@ typedef uint32_t u32;
238
240
typedef uint16_t u16 ;
239
241
typedef uint8_t u8 ;
240
242
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
244
247
typedef enum {RESET = 0 , SET = !RESET } FlagStatus , ITStatus , BitStatus , BitAction ;
245
248
246
249
typedef enum {DISABLE = 0 , ENABLE = !DISABLE } FunctionalState ;
@@ -2936,8 +2939,13 @@ AES_TypeDef;
2936
2939
/*============================== Interrupt vector Handling ========================*/
2937
2940
2938
2941
#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
2941
2949
#endif /* _COSMIC_ */
2942
2950
2943
2951
#ifdef _RAISONANCE_
@@ -2958,7 +2966,11 @@ AES_TypeDef;
2958
2966
2959
2967
/*============================== Interrupt Handler declaration ========================*/
2960
2968
#ifdef _COSMIC_
2961
- #define INTERRUPT @far @interrupt
2969
+ #ifdef __cplusplus
2970
+ #define INTERRUPT
2971
+ #else
2972
+ #define INTERRUPT @interrupt
2973
+ #endif
2962
2974
#elif defined(_IAR_ )
2963
2975
#define INTERRUPT __interrupt
2964
2976
#endif /* _COSMIC_ */
@@ -2993,6 +3005,7 @@ Comments : The different parameters of commands are
2993
3005
#define BYTE_2 (n ) ((uint8_t)(BYTE_0((n) >> (uint8_t)16))) /*!< Returns the third byte of the 32-bit value */
2994
3006
#define BYTE_3 (n ) ((uint8_t)(BYTE_0((n) >> (uint8_t)24))) /*!< Returns the high byte of the 32-bit value */
2995
3007
3008
+ #define UNUSED (x ) ((void)(x))
2996
3009
/*============================== Assert Macros ====================================*/
2997
3010
#define IS_STATE_VALUE (STATE ) \
2998
3011
(((STATE) == SET) || \
0 commit comments