From: Tilman Sauerbeck Date: Sun, 16 Jun 2019 19:50:38 +0000 (+0200) Subject: common: Avoid including core_cm0plus.h and system_MKL26Z4.h. X-Git-Url: http://git.code-monkey.de/?p=gps-watch.git;a=commitdiff_plain;h=97300537f2c9cbb9b27cacc0ae8b34283b96e13c common: Avoid including core_cm0plus.h and system_MKL26Z4.h. Manually add the required functions and macros instead. --- diff --git a/src/common/MKL26Z4.h b/src/common/MKL26Z4.h index c82cde6..5415634 100644 --- a/src/common/MKL26Z4.h +++ b/src/common/MKL26Z4.h @@ -110,6 +110,8 @@ #ifndef _MKL26Z4_H_ #define _MKL26Z4_H_ /**< Symbol preventing repeated inclusion */ +#include + /** Memory map major version (memory maps with equal major version number are * compatible) */ #define MCU_MEM_MAP_VERSION 0x0100U @@ -195,8 +197,20 @@ typedef enum IRQn { #define __NVIC_PRIO_BITS 2 /**< Number of priority bits implemented in the NVIC */ #define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */ -#include "core_cm0plus.h" /* Core Peripheral Access Layer */ -#include "system_MKL26Z4.h" /* Device specific configuration file */ +static inline +uint32_t __get_PRIMASK (void) +{ + uint32_t result; + + asm volatile ("MRS %0, primask" : "=r" (result) :: "memory"); + return(result); +} + +static inline +void __set_PRIMASK (uint32_t priMask) +{ + asm volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} /*! * @} @@ -339,6 +353,18 @@ typedef enum _dma_request_source #error Not supported compiler type #endif +#ifndef __I +# define __I volatile +#endif + +#ifndef __O +# define __O volatile +#endif + +#ifndef __IO +# define __IO volatile +#endif + /* ---------------------------------------------------------------------------- -- ADC Peripheral Access Layer ---------------------------------------------------------------------------- */