diff --git a/g2core/board/Archim/hardware.h b/g2core/board/Archim/hardware.h index 7b3f05c4..d66cae7d 100755 --- a/g2core/board/Archim/hardware.h +++ b/g2core/board/Archim/hardware.h @@ -82,8 +82,6 @@ using Motate::OutputPin; * Global System Defines * *************************/ -#undef F_CPU // CPU clock - set for delays -#define F_CPU 84000000UL #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) #define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) #define SYS_ID_LEN 16 // total length including dashes and NUL diff --git a/g2core/board/ArduinoDue/hardware.h b/g2core/board/ArduinoDue/hardware.h index ed513965..1b5bbe6b 100755 --- a/g2core/board/ArduinoDue/hardware.h +++ b/g2core/board/ArduinoDue/hardware.h @@ -84,8 +84,6 @@ using Motate::OutputPin; * Global System Defines * *************************/ -#undef F_CPU // CPU clock - set for delays -#define F_CPU 84000000UL #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) #define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) #define SYS_ID_LEN 16 // total length including dashes and NUL diff --git a/g2core/board/G2v9/hardware.h b/g2core/board/G2v9/hardware.h index 68fa77a5..835dfc44 100755 --- a/g2core/board/G2v9/hardware.h +++ b/g2core/board/G2v9/hardware.h @@ -84,8 +84,6 @@ using Motate::OutputPin; * Global System Defines * *************************/ -#undef F_CPU // CPU clock - set for delays -#define F_CPU 84000000UL #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) #define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) #define SYS_ID_LEN 16 // total length including dashes and NUL diff --git a/g2core/board/gquadratic/hardware.h b/g2core/board/gquadratic/hardware.h index 3b4fc7bc..069cb2ba 100755 --- a/g2core/board/gquadratic/hardware.h +++ b/g2core/board/gquadratic/hardware.h @@ -85,8 +85,6 @@ using Motate::OutputPin; * Global System Defines * *************************/ -#undef F_CPU // CPU clock - set for delays -#define F_CPU 84000000UL #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) #define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) #define SYS_ID_LEN 16 // total length including dashes and NUL diff --git a/g2core/board/gquintic/hardware.h b/g2core/board/gquintic/hardware.h index 5dbe9ac3..0fb2d541 100755 --- a/g2core/board/gquintic/hardware.h +++ b/g2core/board/gquintic/hardware.h @@ -83,8 +83,6 @@ using Motate::OutputPin; * Global System Defines * *************************/ -#undef F_CPU // CPU clock - set for delays -#define F_CPU 84000000UL #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) #define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) #define SYS_ID_LEN 16 // total length including dashes and NUL diff --git a/g2core/board/printrboardg2/hardware.h b/g2core/board/printrboardg2/hardware.h index 91af3784..6046c789 100755 --- a/g2core/board/printrboardg2/hardware.h +++ b/g2core/board/printrboardg2/hardware.h @@ -82,8 +82,6 @@ using Motate::OutputPin; * Global System Defines * *************************/ -#undef F_CPU // CPU clock - set for delays -#define F_CPU 84000000UL #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) #define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) #define SYS_ID_LEN 16 // total length including dashes and NUL diff --git a/g2core/board/sbv300/hardware.h b/g2core/board/sbv300/hardware.h index 8b930d1e..0e576ab4 100755 --- a/g2core/board/sbv300/hardware.h +++ b/g2core/board/sbv300/hardware.h @@ -82,8 +82,6 @@ using Motate::OutputPin; * Global System Defines * *************************/ -#undef F_CPU // CPU clock - set for delays -#define F_CPU 84000000UL #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) #define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) #define SYS_ID_LEN 16 // total length including dashes and NUL diff --git a/g2core/pwm.cpp b/g2core/pwm.cpp index f141ea8d..82248fdf 100755 --- a/g2core/pwm.cpp +++ b/g2core/pwm.cpp @@ -45,8 +45,8 @@ static Motate::PWMOutputPin secondary_pwm_pin; //#define PWM_TIMER_TYPE TC1_struct // PWM uses TC1's #define PWM_TIMER_t TC1_t // PWM uses TC1's #define PWM_TIMER_DISABLE 0 // turn timer off (clock = 0 Hz) -#define PWM_MAX_FREQ (F_CPU/256) // max frequency with 8-bits duty cycle precision -#define PWM_MIN_FREQ (F_CPU/64/65536) // min frequency with supported prescaling +//#define PWM_MAX_FREQ (F_CPU/256) // max frequency with 8-bits duty cycle precision +//#define PWM_MIN_FREQ (F_CPU/64/65536) // min frequency with supported prescaling // channel specific defines /* CLKSEL is used to configure default PWM clock operating ranges @@ -95,8 +95,8 @@ void pwm_init() {} stat_t pwm_set_freq(uint8_t chan, float freq) { if (chan > PWMS) { return (STAT_NO_SUCH_DEVICE);} - if (freq < PWM_MIN_FREQ) { return (STAT_INPUT_LESS_THAN_MIN_VALUE);} - if (freq > PWM_MAX_FREQ) { return (STAT_INPUT_EXCEEDS_MAX_VALUE);} + //if (freq < PWM_MIN_FREQ) { return (STAT_INPUT_LESS_THAN_MIN_VALUE);} + //if (freq > PWM_MAX_FREQ) { return (STAT_INPUT_EXCEEDS_MAX_VALUE);} if (chan == PWM_1) { spindle_pwm_pin.setFrequency(freq); diff --git a/g2core/stepper.cpp b/g2core/stepper.cpp index 32c70d5e..74b432df 100644 --- a/g2core/stepper.cpp +++ b/g2core/stepper.cpp @@ -51,7 +51,7 @@ static stRunSingleton_t st_run; static void _load_move(void); // handy macro -#define _f_to_period(f) (uint16_t)((float)F_CPU / (float)f) +//#define _f_to_period(f) (uint16_t)((float)F_CPU / (float)f) /**** Setup motate ****/ @@ -658,7 +658,7 @@ stat_t st_prep_line(float travel_steps[], float following_error[], float segment // - dda_ticks is the integer number of DDA clock ticks needed to play out the segment // - ticks_X_substeps is the maximum depth of the DDA accumulator (as a negative number) - st_pre.dda_period = _f_to_period(FREQUENCY_DDA); // FYI: this is a constant + //st_pre.dda_period = _f_to_period(FREQUENCY_DDA); // FYI: this is a constant st_pre.dda_ticks = (int32_t)(segment_time * 60 * FREQUENCY_DDA);// NB: converts minutes to seconds st_pre.dda_ticks_X_substeps = st_pre.dda_ticks * DDA_SUBSTEPS; @@ -753,7 +753,7 @@ void st_prep_command(void *bf) void st_prep_dwell(float microseconds) { st_pre.block_type = BLOCK_TYPE_DWELL; - st_pre.dda_period = _f_to_period(FREQUENCY_DWELL); + //st_pre.dda_period = _f_to_period(FREQUENCY_DWELL); st_pre.dda_ticks = (uint32_t)((microseconds/1000000) * FREQUENCY_DWELL); st_pre.buffer_state = PREP_BUFFER_OWNED_BY_LOADER; // signal that prep buffer is ready } diff --git a/g2core/stepper.h b/g2core/stepper.h index 0a973ad7..6c1967dd 100644 --- a/g2core/stepper.h +++ b/g2core/stepper.h @@ -413,7 +413,7 @@ typedef struct stPrepSingleton { struct mpBuffer *bf; // static pointer to relevant buffer blockType block_type; // move type (requires planner.h) - uint16_t dda_period; // DDA or dwell clock period setting + //uint16_t dda_period; // DDA or dwell clock period setting (No longer used) uint32_t dda_ticks; // DDA or dwell ticks for the move uint32_t dda_ticks_X_substeps; // DDA ticks scaled by substep factor stPrepMotor_t mot[MOTORS]; // prep time motor structs