18#ifndef __USE_MCS51_COMPILER_H_PART_1__
19#define __USE_MCS51_COMPILER_H_PART_1__
29#if __IS_COMPILER_IAR__
30# include <intrinsics.h>
33#ifndef __VSF_HEADER_ONLY_SHOW_COMPILER_INFO__
36#include "../__common/__compiler.h"
41#ifndef __USE_MCS51_COMPILER_H_PART_2__
42#define __USE_MCS51_COMPILER_H_PART_2__
49#if __IS_COMPILER_51_KEIL__
52#elif __IS_COMPILER_IAR__
53 #pragma language=extended
55 #warning Not supported compiler type
61#if __IS_COMPILER_IAR__
62# define LOW_LEVEL_INIT_RET_T char
63# define VSF_CAL_NO_INIT __no_init
64# define VSF_CAL_NO_RETURN _Pragma("object_attribute=__noreturn")
65# define VSF_CAL_ROOT __root
66# define VSF_CAL_INLINE inline
67# define VSF_CAL_NO_INLINE _Pragma("optimisze=no_inline")
68# define VSF_CAL_ALWAYS_INLINE _Pragma("inline=forced")
69# define VSF_CAL_WEAK(...) _Pragma(__VSF_STR(weak __VA_ARGS__))
70# define VSF_CAL_RAMFUNC __ramfunc
72# define __VSF_CAL_ALIGN(__N)
73# define __VSF_CAL_AT_ADDR(__ADDR) @ __ADDR
74# define __VSF_CAL_SECTION(__SEC) _Pragma(__VSF_STR(section=__SEC))
75# define __VSF_CAL_WEAK_ALIAS(__ORIGIN, __ALIAS) \
76 _Pragma(__VSF_STR(weak __ORIGIN=__ALIAS))
77# define VSF_CAL_PACKED
78# define VSF_CAL_UNALIGNED
79# define VSF_CAL_TRANSPARENT_UNION
80# define __VSF_CAL_ALIGN_OF(...) __ALIGNOF__(__VA_ARGS__)
82#define __VSF_CAL_ISR(__VEC) \
83 _Pragma(__VSF_STR(vector=__VEC)) \
84 __interrupt void vect_##__VEC##_handler(void)
89# define __IAR_STARTUP_DATA_INIT __INIT_XDATA_Z
93 #define NOP() __no_operation()
96#elif __IS_COMPILER_51_KEIL__
98# define VSF_CAL_NO_INIT
99# define VSF_CAL_NO_RETURN
101# define VSF_CAL_INLINE
102# define VSF_CAL_NO_INLINE
103# define VSF_CAL_ALWAYS_INLINE
104# define VSF_CAL_WEAK(__ANYTHING)
105# define VSF_CAL_RAMFUNC
106# define __asm__ __asm
107# define __VSF_CAL_ALIGN(__N)
108# define __VSF_CAL_AT_ADDR(__ADDR)
109# define __VSF_CAL_SECTION(__SEC)
110# define __VSF_CAL_WEAK_ALIAS(__ORIGIN, __ALIAS)
111# define VSF_CAL_PACKED
112# define VSF_CAL_UNALIGNED
113# define VSF_CAL_TRANSPARENT_UNION
114# define __VSF_CAL_ALIGN_OF(__ANYTHING)
116# define __VSF_CAL_ISR(__VEC) \
117 void vect_##__VEC##_handler(void) interrupt __VEC
122# define __IAR_STARTUP_DATA_INIT __INIT_XDATA_I
126#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
127#define VSF_CAL_ALIGN_OF(__TYPE) __VSF_CAL_ALIGN_OF(__TYPE)
128#define VSF_CAL_ALIGN_WITH(__TYPE) VSF_CAL_ALIGN(VSF_CAL_ALIGN_OF(__TYPE))
129#define VSF_CAL_ISR(__VECT) __VSF_CAL_ISR(__VECT)
131#define VSF_CAL_ALIGN_OF(...) __VSF_CAL_ALIGN_OF(__VA_ARGS__)
132#define VSF_CAL_ALIGN_WITH(...) VSF_CAL_ALIGN(VSF_CAL_ALIGN_OF(__VA_ARGS__))
133#define VSF_CAL_ISR(...) __VSF_CAL_ISR(__VA_ARGS__)
141#if __IS_COMPILER_IAR__
142# define ENABLE_GLOBAL_INTERRUPT() __enable_interrupt()
143#elif __IS_COMPILER_51_KEIL__
144# define ENABLE_GLOBAL_INTERRUPT() __enable_interrupt()
148#if __IS_COMPILER_IAR__
149# define DISABLE_GLOBAL_INTERRUPT() ____disable_irq()
152static uint32_t ____disable_irq(
void)
154 __istate_t s = __get_interrupt_state();
155 __disable_interrupt();
158#elif __IS_COMPILER_51_KEIL__
159# define DISABLE_GLOBAL_INTERRUPT() __disable_interrupt()
162#if __IS_COMPILER_IAR__
163# define GET_GLOBAL_INTERRUPT_STATE() __get_interrupt_state()
164# define SET_GLOBAL_INTERRUPT_STATE(__STATE) __set_interrupt_state(__STATE)
166#elif __IS_COMPILER_51_KEIL__
167# define GET_GLOBAL_INTERRUPT_STATE() __get_interrupt_state()
168# define SET_GLOBAL_INTERRUPT_STATE(__STATE) __set_interrupt_state(__STATE)
volatile bool vsf_gint_state_t
Definition linux_generic.h:114
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
void vsf_stdio_init(void)