Skip to content

Commit

Permalink
Use bultin __SDCC define
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 committed Jul 18, 2024
1 parent bdf29c9 commit 6b7e5ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"./src/STM8S_StdPeriph_Lib/inc"
],
"defines": [
"__SDCC",
"STM8S105",
"__interrupt(SDCC_IntelliSense_Hack)=",
"__CDT_PARSER__"
Expand Down
13 changes: 6 additions & 7 deletions src/STM8S_StdPeriph_Lib/inc/stm8s.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
/******************************************************************************/
/* Library configuration section */
/******************************************************************************/
#define SDCC

/* Check the used compiler */
#if defined(__CSMC__)
Expand All @@ -87,10 +86,8 @@
#define _RAISONANCE_
#elif defined(__ICCSTM8__)
#define _IAR_
#elif defined(SDCC)
#elif defined(__SDCC)
#define _SDCC_
#else
#error "Unsupported Compiler!" /* Compiler defines not found */
#endif

#if !defined USE_STDPERIPH_DRIVER
Expand Down Expand Up @@ -217,9 +214,7 @@
#define __O volatile /*!< defines 'write only' permissions */
#define __IO volatile /*!< defines 'read / write' permissions */

#if defined(_SDCC_)
#include <stdint.h>
#else
#if defined(_COSMIC_) || defined(_RAISONANCE_) || defined(_IAR_)
/*!< Signed integer types */
typedef signed char int8_t;
typedef signed short int16_t;
Expand All @@ -229,6 +224,10 @@ typedef signed long int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
#elif defined(_SDCC_)
#include <stdint.h>
#else
#include <stdint.h>
#endif

/*!< STM8 Standard Peripheral Library old types (maintained for legacy purpose) */
Expand Down
2 changes: 0 additions & 2 deletions src/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ static inline void _delay_cycl( unsigned short __ticks )
#elif defined(__ICCSTM8__)
/* IAR */
#error ToDo for IAR
#else
#error Unsupported Compiler! /* Compiler defines not found */
#endif
}

Expand Down

0 comments on commit 6b7e5ff

Please sign in to comment.