Drop pgm_read_*_near and let headers choose (#12301)

- Drop `pgm_read_*_near` and let headers choose.
- Define `USE_EXECUTE_COMMANDS_IMMEDIATE` as a conditional.
- Add `process_subcommands_now` for SRAM-based commands.
This commit is contained in:
Scott Lahteine
2018-11-02 00:42:16 -05:00
committed by GitHub
parent fce150f094
commit 31c28d0dd2
7 changed files with 48 additions and 41 deletions

View File

@ -1803,7 +1803,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
LOOP_XYZE_N(i) {
planner.settings.axis_steps_per_mm[i] = pgm_read_float(&tmp1[ALIM(i, tmp1)]);
planner.settings.max_feedrate_mm_s[i] = pgm_read_float(&tmp2[ALIM(i, tmp2)]);
planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword_near(&tmp3[ALIM(i, tmp3)]);
planner.settings.max_acceleration_mm_per_s2[i] = pgm_read_dword(&tmp3[ALIM(i, tmp3)]);
}
planner.settings.min_segment_time_us = DEFAULT_MINSEGMENTTIME;

View File

@ -95,8 +95,8 @@ extern int16_t feedrate_percentage;
extern float soft_endstop_min[XYZ], soft_endstop_max[XYZ];
FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float_near(p); }
FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte_near(p); }
FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float(p); }
FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte(p); }
#define XYZ_DEFS(type, array, CONFIG) \
extern const type array##_P[XYZ]; \

View File

@ -526,15 +526,15 @@ class Stepper {
if (step_rate >= (8 * 256)) { // higher step rate
const uint8_t tmp_step_rate = (step_rate & 0x00FF);
const uint16_t table_address = (uint16_t)&speed_lookuptable_fast[(uint8_t)(step_rate >> 8)][0],
gain = (uint16_t)pgm_read_word_near(table_address + 2);
gain = (uint16_t)pgm_read_word(table_address + 2);
timer = MultiU16X8toH16(tmp_step_rate, gain);
timer = (uint16_t)pgm_read_word_near(table_address) - timer;
timer = (uint16_t)pgm_read_word(table_address) - timer;
}
else { // lower step rates
uint16_t table_address = (uint16_t)&speed_lookuptable_slow[0][0];
table_address += ((step_rate) >> 1) & 0xFFFC;
timer = (uint16_t)pgm_read_word_near(table_address)
- (((uint16_t)pgm_read_word_near(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3);
timer = (uint16_t)pgm_read_word(table_address)
- (((uint16_t)pgm_read_word(table_address + 2) * (uint8_t)(step_rate & 0x0007)) >> 3);
}
// (there is no need to limit the timer value here. All limits have been
// applied above, and AVR is able to keep up at 30khz Stepping ISR rate)