SAMD51 SoftwareSerial (#17041)

2.0.x
Scott Lahteine 5 years ago committed by GitHub
parent d4ac78535c
commit 631addbbb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,7 +37,7 @@
/** /**
* Magic I/O routines * Magic I/O routines
* *
* Now you can simply SET_OUTPUT(STEP); WRITE(STEP, HIGH); WRITE(STEP, LOW); * Now you can simply SET_OUTPUT(IO); WRITE(IO, HIGH); WRITE(IO, LOW);
*/ */
// Read a pin // Read a pin

@ -23,6 +23,10 @@
* Test SAMD51 specific configuration values for errors at compile-time. * Test SAMD51 specific configuration values for errors at compile-time.
*/ */
#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM)
#warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Manager/releases"
#endif
#if defined(ADAFRUIT_GRAND_CENTRAL_M4) && SD_CONNECTION_IS(CUSTOM_CABLE) #if defined(ADAFRUIT_GRAND_CENTRAL_M4) && SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board." #error "No custom SD drive cable defined for this board."
#endif #endif
@ -42,11 +46,3 @@
#if ENABLED(FAST_PWM_FAN) #if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform." #error "FAST_PWM_FAN is not yet implemented for this platform."
#endif #endif
#if ENABLED(EEPROM_SETTINGS) && NONE(SPI_EEPROM, I2C_EEPROM)
#warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Manager/releases"
#endif
#if HAS_TMC_SW_SERIAL
#error "TMC220x Software Serial is not supported on this platform."
#endif

@ -42,7 +42,7 @@ const tTimerConfig TimerConfig[NUM_HARDWARE_TIMERS+1] = {
{ {.pTc=TC1}, TC1_IRQn, TC_PRIORITY(1) }, // 1 - stepper (needed by 32 bit timers) { {.pTc=TC1}, TC1_IRQn, TC_PRIORITY(1) }, // 1 - stepper (needed by 32 bit timers)
{ {.pTc=TC2}, TC2_IRQn, TC_PRIORITY(2) }, // 2 - tone (framework) { {.pTc=TC2}, TC2_IRQn, TC_PRIORITY(2) }, // 2 - tone (framework)
{ {.pTc=TC3}, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo { {.pTc=TC3}, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo
{ {.pTc=TC4}, TC4_IRQn, TC_PRIORITY(4) }, { {.pTc=TC4}, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial
{ {.pTc=TC5}, TC5_IRQn, TC_PRIORITY(5) }, { {.pTc=TC5}, TC5_IRQn, TC_PRIORITY(5) },
{ {.pTc=TC6}, TC6_IRQn, TC_PRIORITY(6) }, { {.pTc=TC6}, TC6_IRQn, TC_PRIORITY(6) },
{ {.pTc=TC7}, TC7_IRQn, TC_PRIORITY(7) }, { {.pTc=TC7}, TC7_IRQn, TC_PRIORITY(7) },
@ -145,12 +145,12 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
} }
void HAL_timer_enable_interrupt(const uint8_t timer_num) { void HAL_timer_enable_interrupt(const uint8_t timer_num) {
IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; const IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
NVIC_EnableIRQ(irq); NVIC_EnableIRQ(irq);
} }
void HAL_timer_disable_interrupt(const uint8_t timer_num) { void HAL_timer_disable_interrupt(const uint8_t timer_num) {
IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; const IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
Disable_Irq(irq); Disable_Irq(irq);
} }
@ -160,7 +160,7 @@ static bool NVIC_GetEnabledIRQ(IRQn_Type IRQn) {
} }
bool HAL_timer_interrupt_enabled(const uint8_t timer_num) { bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
IRQn_Type irq = TimerConfig[timer_num].IRQ_Id; const IRQn_Type irq = TimerConfig[timer_num].IRQ_Id;
return NVIC_GetEnabledIRQ(irq); return NVIC_GetEnabledIRQ(irq);
} }

@ -57,16 +57,16 @@ typedef uint32_t hal_timer_t;
: (t == TEMP_TIMER_NUM) ? 6 \ : (t == TEMP_TIMER_NUM) ? 6 \
: 7 : 7
#define _TC_HANDLER(t) void TC##t##_Handler() #define _TC_HANDLER(t) void TC##t##_Handler()
#define TC_HANDLER(t) _TC_HANDLER(t) #define TC_HANDLER(t) _TC_HANDLER(t)
#define HAL_STEP_TIMER_ISR() TC_HANDLER(STEP_TIMER_NUM) #define HAL_STEP_TIMER_ISR() TC_HANDLER(STEP_TIMER_NUM)
#if STEP_TIMER_NUM != PULSE_TIMER_NUM #if STEP_TIMER_NUM != PULSE_TIMER_NUM
#define HAL_PULSE_TIMER_ISR() TC_HANDLER(PULSE_TIMER_NUM) #define HAL_PULSE_TIMER_ISR() TC_HANDLER(PULSE_TIMER_NUM)
#endif #endif
#if TEMP_TIMER_NUM == RTC_TIMER_NUM #if TEMP_TIMER_NUM == RTC_TIMER_NUM
#define HAL_TEMP_TIMER_ISR() void RTC_Handler() #define HAL_TEMP_TIMER_ISR() void RTC_Handler()
#else #else
#define HAL_TEMP_TIMER_ISR() TC_HANDLER(TEMP_TIMER_NUM) #define HAL_TEMP_TIMER_ISR() TC_HANDLER(TEMP_TIMER_NUM)
#endif #endif
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

@ -771,20 +771,20 @@ src_build_flags = -Wall -IMarlin/src/HAL/HAL_LINUX/include
build_unflags = -Wall build_unflags = -Wall
lib_ldf_mode = off lib_ldf_mode = off
lib_deps = lib_deps =
extra_scripts =
src_filter = ${common.default_src_filter} +<src/HAL/HAL_LINUX> src_filter = ${common.default_src_filter} +<src/HAL/HAL_LINUX>
# #
# Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4) # Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4)
# #
[env:SAMD51_grandcentral_m4] [env:SAMD51_grandcentral_m4]
platform = atmelsam platform = atmelsam
board = adafruit_grandcentral_m4 board = adafruit_grandcentral_m4
build_flags = ${common.build_flags} -std=gnu++17 build_flags = ${common.build_flags} -std=gnu++17 -Wno-register
extra_scripts = ${common.extra_scripts} build_unflags = -std=gnu++11
build_unflags = -std=gnu++11 src_filter = ${common.default_src_filter} +<src/HAL/HAL_SAMD51>
src_filter = ${common.default_src_filter} +<src/HAL/HAL_SAMD51> lib_deps = ${common.lib_deps}
debug_tool = jlink SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
debug_tool = jlink
# #
# RUMBA32 # RUMBA32

Loading…
Cancel
Save