Move speed tables into the boot section in debug
This allows the debug build to fit/work correctly.pull/151/head
parent
5bf3ceff14
commit
5fb5ad98fc
|
|
@ -6,7 +6,7 @@ namespace speed_table {
|
|||
|
||||
#if F_CPU == 16000000
|
||||
|
||||
const st_timer_t speed_table_fast[256][2] PROGMEM = {
|
||||
const st_timer_t speed_table_fast[256][2] ST_PROGMEM = {
|
||||
{ 62500, 55556 }, { 6944, 3268 }, { 3676, 1176 }, { 2500, 607 }, { 1893, 369 }, { 1524, 249 }, { 1275, 179 }, { 1096, 135 },
|
||||
{ 961, 105 }, { 856, 85 }, { 771, 69 }, { 702, 58 }, { 644, 49 }, { 595, 42 }, { 553, 37 }, { 516, 32 },
|
||||
{ 484, 28 }, { 456, 25 }, { 431, 23 }, { 408, 20 }, { 388, 19 }, { 369, 16 }, { 353, 16 }, { 337, 14 },
|
||||
|
|
@ -41,7 +41,7 @@ const st_timer_t speed_table_fast[256][2] PROGMEM = {
|
|||
{ 31, 0 }, { 31, 0 }, { 31, 0 }, { 31, 1 }, { 30, 0 }, { 30, 0 }, { 30, 0 }, { 30, 0 }
|
||||
};
|
||||
|
||||
const st_timer_t speed_table_slow[256][2] PROGMEM = {
|
||||
const st_timer_t speed_table_slow[256][2] ST_PROGMEM = {
|
||||
{ 62500, 12500 }, { 50000, 8334 }, { 41666, 5952 }, { 35714, 4464 }, { 31250, 3473 }, { 27777, 2777 }, { 25000, 2273 }, { 22727, 1894 },
|
||||
{ 20833, 1603 }, { 19230, 1373 }, { 17857, 1191 }, { 16666, 1041 }, { 15625, 920 }, { 14705, 817 }, { 13888, 731 }, { 13157, 657 },
|
||||
{ 12500, 596 }, { 11904, 541 }, { 11363, 494 }, { 10869, 453 }, { 10416, 416 }, { 10000, 385 }, { 9615, 356 }, { 9259, 331 },
|
||||
|
|
|
|||
|
|
@ -5,6 +5,13 @@
|
|||
#include "../hal/cpu.h"
|
||||
#include "math.h"
|
||||
|
||||
// Move speed tables into the bootloader section in debug builds to conserve data space
|
||||
#if defined(_DEBUG) && defined(__AVR__)
|
||||
#define ST_PROGMEM __attribute__((section(".boot1")))
|
||||
#else
|
||||
#define ST_PROGMEM PROGMEM
|
||||
#endif
|
||||
|
||||
namespace modules {
|
||||
|
||||
/// Speed tables for acceleration calculations
|
||||
|
|
@ -17,10 +24,10 @@ static_assert(F_CPU / config::stepTimerFrequencyDivider == 2000000,
|
|||
"speed tables not compatible for the requested frequency");
|
||||
|
||||
/// Lookup table for rates equal or higher than 8*256
|
||||
extern const st_timer_t speed_table_fast[256][2] PROGMEM;
|
||||
extern const st_timer_t speed_table_fast[256][2] ST_PROGMEM;
|
||||
|
||||
/// Lookup table for lower step rates
|
||||
extern const st_timer_t speed_table_slow[256][2] PROGMEM;
|
||||
extern const st_timer_t speed_table_slow[256][2] ST_PROGMEM;
|
||||
|
||||
/// Calculate the next timer interval and steps according to current step rate
|
||||
static inline st_timer_t calc_timer(st_timer_t step_rate, uint8_t &step_loops) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue