note: - модбас не моделируется, в s-function просто передаются константы режимов. - лишние файлы убраны в outdate. - два канала одной фазы переключаются немного криво: на один такт симуляции проскакивает высокий уровень предыдущего канала и только потом включается текущий канал
105 lines
2.4 KiB
C
105 lines
2.4 KiB
C
|
|
#define __disable_irq()
|
|
|
|
#ifndef __ASM
|
|
#define __ASM __asm
|
|
#endif
|
|
|
|
#ifndef __IO
|
|
#define __IO volatile
|
|
#endif
|
|
|
|
#ifndef __inline
|
|
#define __inline inline
|
|
#endif
|
|
|
|
#ifndef __NOINLINE
|
|
#define __NOINLINE __declspec(noinline)
|
|
#endif
|
|
|
|
#ifndef __INLINE
|
|
#define __INLINE __inline
|
|
#endif
|
|
|
|
#ifndef __STATIC_INLINE
|
|
#define __STATIC_INLINE static __inline
|
|
#endif
|
|
|
|
#ifndef __STATIC_FORCEINLINE
|
|
#define __STATIC_FORCEINLINE static __forceinline
|
|
#endif
|
|
|
|
#ifndef __NO_RETURN
|
|
#define __NO_RETURN __declspec(noreturn)
|
|
#endif
|
|
|
|
#ifndef __USED
|
|
#define __USED __attribute__((used))
|
|
#endif
|
|
|
|
|
|
#ifndef __WEAK
|
|
#define __WEAK __declspec(selectany)
|
|
// #define __weak __WEAK
|
|
#endif
|
|
|
|
#ifndef __PACKED
|
|
#define __PACKED __attribute__((packed))
|
|
#endif
|
|
|
|
#ifndef __PACKED_STRUCT
|
|
#define __PACKED_STRUCT __packed struct
|
|
#endif
|
|
|
|
#ifndef __PACKED_UNION
|
|
#define __PACKED_UNION __packed union
|
|
#endif
|
|
|
|
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
|
#define __UNALIGNED_UINT32(x) (*((__packed uint32_t *)(x)))
|
|
#endif
|
|
|
|
#ifndef __UNALIGNED_UINT16_WRITE
|
|
#define __UNALIGNED_UINT16_WRITE(addr, val) ((*((__packed uint16_t *)(addr))) = (val))
|
|
#endif
|
|
|
|
#ifndef __UNALIGNED_UINT16_READ
|
|
#define __UNALIGNED_UINT16_READ(addr) (*((const __packed uint16_t *)(addr)))
|
|
#endif
|
|
|
|
#ifndef __UNALIGNED_UINT32_WRITE
|
|
#define __UNALIGNED_UINT32_WRITE(addr, val) ((*((__packed uint32_t *)(addr))) = (val))
|
|
#endif
|
|
|
|
#ifndef __UNALIGNED_UINT32_READ
|
|
#define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr)))
|
|
#endif
|
|
|
|
#ifndef __ALIGNED
|
|
#define __ALIGNED(x) __attribute__((aligned(x)))
|
|
#endif
|
|
|
|
#ifndef __RESTRICT
|
|
#define __RESTRICT __restrict
|
|
#endif
|
|
|
|
//#define __CLZ (uint8_t)clz
|
|
//
|
|
//#define __CTZ (uint8_t)ctz
|
|
|
|
#define __CLZ
|
|
#define __CTZ
|
|
#define __RBIT
|
|
|
|
#ifndef __weak
|
|
#define __weak
|
|
#endif
|
|
#define __DSB()
|
|
#define __ISB()
|
|
#define __NOP()
|
|
#define __WFI()
|
|
#define __SEV()
|
|
#define __WFE()
|
|
#define __DMB()
|
|
|