Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit d97b970

Browse files
ridhaosWi6labsVVESTM
authored andcommitted
Update STM8Lxx for Cosmic compatibility
Rename SPL to be more generic.
1 parent 03b0091 commit d97b970

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+21
-8
lines changed

system/Drivers/STM8L15x_StdPeriph_Driver/inc/stm8l15x.h renamed to system/Drivers/STM8Lxx_StdPeriph_Driver/inc/stm8l15x.h

+20-7
Original file line numberDiff line numberDiff line change
@@ -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 */
222224
typedef signed char int8_t;
223225
typedef signed short int16_t;
@@ -238,9 +240,10 @@ typedef uint32_t u32;
238240
typedef uint16_t u16;
239241
typedef 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
244247
typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus, BitStatus, BitAction;
245248

246249
typedef 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) || \

system/Drivers/STM8L15x_StdPeriph_Driver/src/stm8l15x_itc.c renamed to system/Drivers/STM8Lxx_StdPeriph_Driver/src/stm8l15x_itc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ uint8_t ITC_GetCPUCC(void)
5858
#ifdef _COSMIC_
5959
_asm("push cc");
6060
_asm("pop a");
61-
return; /* Ignore compiler warning, the returned value is in A register */
61+
//return; /* Ignore compiler warning, the returned value is in A register */
6262
#elif defined _RAISONANCE_ /* _RAISONANCE_ */
6363
return _getCC_();
6464
#else /* _IAR_ */

0 commit comments

Comments
 (0)