Skip to content

Commit

Permalink
🐛 Fix DUE compile and errors (MarlinFirmware#24809)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejtagle authored and thinkyhead committed Dec 16, 2022
1 parent 5aca6ff commit a58f277
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class MarlinHAL {
static void adc_init() {}

// Called by Temperature::init for each sensor at startup
static void adc_enable(const uint8_t ch) {}
static void adc_enable(const uint8_t /*ch*/) {}

// Begin ADC sampling on the given channel. Called from Temperature::isr!
static void adc_start(const uint8_t ch) { adc_result = analogRead(ch); }
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/DUE/HAL_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@
b <<= 1; // little setup time

WRITE(SD_SCK_PIN, HIGH);
DELAY_NS(spiDelayNS);
DELAY_NS_VAR(spiDelayNS);

b |= (READ(SD_MISO_PIN) != 0);

WRITE(SD_SCK_PIN, LOW);
DELAY_NS(spiDelayNS);
DELAY_NS_VAR(spiDelayNS);
} while (--bits);
return b;
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/InterruptVectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
practice, we need alignment to 256 bytes to make this work in all
cases */
__attribute__ ((aligned(256)))
static DeviceVectors ram_tab = { nullptr };
static DeviceVectors ram_tab[61] = { nullptr };

/**
* This function checks if the exception/interrupt table is already in SRAM or not.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/usb/usb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void usb_task_idle(void) {
// Attend SD card access from the USB MSD -- Prioritize access to improve speed
int delay = 2;
while (main_b_msc_enable && --delay > 0) {
if (udi_msc_process_trans()) delay = 10000;
if (udi_msc_process_trans()) delay = 20;

// Reset the watchdog, just to be sure
REG_WDT_CR = WDT_CR_WDRSTT | WDT_CR_KEY(0xA5);
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ struct Flags {
void set(const int n) { b |= (bits_t)_BV(n); }
void clear(const int n) { b &= ~(bits_t)_BV(n); }
bool test(const int n) const { return TEST(b, n); }
const bool operator[](const int n) { return test(n); }
const bool operator[](const int n) const { return test(n); }
bool operator[](const int n) { return test(n); }
bool operator[](const int n) const { return test(n); }
int size() const { return sizeof(b); }
};

Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/module/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ typedef struct PlannerBlock {

volatile block_flags_t flag; // Block flags

volatile bool is_fan_sync() { return TERN0(LASER_SYNCHRONOUS_M106_M107, flag.sync_fans); }
volatile bool is_pwr_sync() { return TERN0(LASER_POWER_SYNC, flag.sync_laser_pwr); }
volatile bool is_sync() { return flag.sync_position || is_fan_sync() || is_pwr_sync(); }
volatile bool is_page() { return TERN0(DIRECT_STEPPING, flag.page); }
volatile bool is_move() { return !(is_sync() || is_page()); }
bool is_fan_sync() { return TERN0(LASER_SYNCHRONOUS_M106_M107, flag.sync_fans); }
bool is_pwr_sync() { return TERN0(LASER_POWER_SYNC, flag.sync_laser_pwr); }
bool is_sync() { return flag.sync_position || is_fan_sync() || is_pwr_sync(); }
bool is_page() { return TERN0(DIRECT_STEPPING, flag.page); }
bool is_move() { return !(is_sync() || is_page()); }

// Fields used by the motion planner to manage acceleration
float nominal_speed, // The nominal speed for this block in (mm/sec)
Expand Down

0 comments on commit a58f277

Please sign in to comment.