diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h index 5674e57a..8f1aba87 100644 --- a/cores/arduino/HardwareSerial.h +++ b/cores/arduino/HardwareSerial.h @@ -26,7 +26,7 @@ class HardwareSerial : public Stream { public: - virtual void begin(unsigned long); + virtual void begin(uint32_t); virtual void end(); virtual int available(void) = 0; virtual int peek(void) = 0; diff --git a/cores/arduino/Reset.cpp b/cores/arduino/Reset.cpp index 67ef9e32..e0d830ff 100644 --- a/cores/arduino/Reset.cpp +++ b/cores/arduino/Reset.cpp @@ -23,7 +23,11 @@ extern "C" { #endif +#if !defined(__clang__) || defined(__mips__) __attribute__ ((long_call, section (".ramfunc"))) +#else +__attribute__ ((section (".ramfunc"))) +#endif void banzai() { // Disable all interrupts __disable_irq(); diff --git a/cores/arduino/USB/CDC.cpp b/cores/arduino/USB/CDC.cpp index dea6bd2b..4b93cf91 100644 --- a/cores/arduino/USB/CDC.cpp +++ b/cores/arduino/USB/CDC.cpp @@ -336,7 +336,7 @@ int32_t Serial_::readBreak() { return ret; } -unsigned long Serial_::baud() { +uint32_t Serial_::baud() { return _usbLineInfo.dwDTERate; } diff --git a/system/CMSIS/CMSIS/Include/core_cmFunc.h b/system/CMSIS/CMSIS/Include/core_cmFunc.h index 88819f9d..69289534 100644 --- a/system/CMSIS/CMSIS/Include/core_cmFunc.h +++ b/system/CMSIS/CMSIS/Include/core_cmFunc.h @@ -300,6 +300,13 @@ static __INLINE void __set_FPSCR(uint32_t fpscr) #elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ /* GNU gcc specific functions */ +/* C++17 removes register keyword */ +#if __cplusplus >= 201703L +# define DEPRECATED_REGISTER +#else +# define DEPRECATED_REGISTER register +#endif + /** \brief Enable IRQ Interrupts This function enables IRQ interrupts by clearing the I-bit in the CPSR. @@ -402,7 +409,7 @@ __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_xPSR(void) */ __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_PSP(void) { - register uint32_t result; + DEPRECATED_REGISTER uint32_t result; __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); return(result); @@ -429,7 +436,7 @@ __attribute__( ( always_inline ) ) static __INLINE void __set_PSP(uint32_t topOf */ __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_MSP(void) { - register uint32_t result; + DEPRECATED_REGISTER uint32_t result; __ASM volatile ("MRS %0, msp\n" : "=r" (result) ); return(result); @@ -591,6 +598,8 @@ __attribute__( ( always_inline ) ) static __INLINE void __set_FPSCR(uint32_t fps #endif /* (__CORTEX_M == 0x04) */ +#undef DEPRECATED_REGISTER + #elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ /* TASKING carm specific functions */