diff --git a/g2core/gpio.cpp b/g2core/gpio.cpp index 02bf650f..51ca4a60 100644 --- a/g2core/gpio.cpp +++ b/g2core/gpio.cpp @@ -55,8 +55,6 @@ #include "xio.h" #include "MotateTimers.h" -using namespace Motate; - /**** * * Important: Do not directly allocate or access pins here! diff --git a/g2core/main.cpp b/g2core/main.cpp index b0a57ff2..2bed0f80 100644 --- a/g2core/main.cpp +++ b/g2core/main.cpp @@ -55,13 +55,10 @@ stat_t status_code; // allocate a variable for the ritorno macro // See also: util.h for debugging and diagnostics // Using motate pins for profiling -// Usage: https://github.com/synthetos/g2/wiki/Using-Pin-Changes-for-Timing-(and-light-debugging) - -using namespace Motate; -OutputPin debug_pin1; -OutputPin debug_pin2; -OutputPin debug_pin3; -OutputPin debug_pin4; +// Usage: https://github.com/synthetos/g2/wiki/Using-Pin-Changes-for-Timing-(and-light-debugging)OutputPin debug_pin1; +OutputPin debug_pin2; +OutputPin debug_pin3; +OutputPin debug_pin4; // or these to disable the pin //OutputPin<-1> debug_pin1; @@ -70,12 +67,10 @@ OutputPin debug_pin4; //OutputPin<-1> debug_pin4; // Put these lines in the .cpp file where you are using the debug pins (appropriately commented / uncommented) -/* -using namespace Motate; -extern OutputPin debug_pin1; -extern OutputPin debug_pin2; -extern OutputPin debug_pin3; -extern OutputPin debug_pin4; +/*extern OutputPin debug_pin1; +extern OutputPin debug_pin2; +extern OutputPin debug_pin3; +extern OutputPin debug_pin4; //extern OutputPin<-1> debug_pin1; //extern OutputPin<-1> debug_pin2; diff --git a/g2core/plan_line.cpp b/g2core/plan_line.cpp index 8ca8028e..83cfb246 100644 --- a/g2core/plan_line.cpp +++ b/g2core/plan_line.cpp @@ -42,10 +42,9 @@ // Using motate pins for profiling (see main.cpp) // see https://github.com/synthetos/g2/wiki/Using-Pin-Changes-for-Timing-(and-light-debugging) -using namespace Motate; -extern OutputPin debug_pin1; -extern OutputPin debug_pin2; -extern OutputPin debug_pin3; +extern OutputPin debug_pin1; +extern OutputPin debug_pin2; +extern OutputPin debug_pin3; // planner helper functions static mpBuf_t* _plan_block(mpBuf_t* bf); diff --git a/g2core/settings/settings_Printrbot_Play.h b/g2core/settings/settings_Printrbot_Play.h index 7c7acb29..0ddb44ad 100644 --- a/g2core/settings/settings_Printrbot_Play.h +++ b/g2core/settings/settings_Printrbot_Play.h @@ -262,7 +262,7 @@ #if HAS_TEMPERATURE_SENSOR_1 #define TEMPERATURE_SENSOR_1_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_1_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_1_TYPE Thermistor> + #define TEMPERATURE_SENSOR_1_TYPE Thermistor> #define TEMPERATURE_SENSOR_1_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ @@ -277,7 +277,7 @@ #if HAS_TEMPERATURE_SENSOR_2 #define TEMPERATURE_SENSOR_2_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_2_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_2_TYPE Thermistor> + #define TEMPERATURE_SENSOR_2_TYPE Thermistor> #define TEMPERATURE_SENSOR_2_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ @@ -292,7 +292,7 @@ #if HAS_TEMPERATURE_SENSOR_3 #define TEMPERATURE_SENSOR_3_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_3_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_3_TYPE Thermistor> + #define TEMPERATURE_SENSOR_3_TYPE Thermistor> #define TEMPERATURE_SENSOR_3_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ diff --git a/g2core/settings/settings_Printrbot_Plus.h b/g2core/settings/settings_Printrbot_Plus.h index a2971968..4b3ff2c1 100644 --- a/g2core/settings/settings_Printrbot_Plus.h +++ b/g2core/settings/settings_Printrbot_Plus.h @@ -249,7 +249,7 @@ #if HAS_TEMPERATURE_SENSOR_1 #define TEMPERATURE_SENSOR_1_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_1_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_1_TYPE Thermistor> + #define TEMPERATURE_SENSOR_1_TYPE Thermistor> #define TEMPERATURE_SENSOR_1_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ @@ -264,7 +264,7 @@ #if HAS_TEMPERATURE_SENSOR_2 #define TEMPERATURE_SENSOR_2_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_2_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_2_TYPE Thermistor> + #define TEMPERATURE_SENSOR_2_TYPE Thermistor> #define TEMPERATURE_SENSOR_2_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ @@ -279,7 +279,7 @@ #if HAS_TEMPERATURE_SENSOR_3 #define TEMPERATURE_SENSOR_3_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_3_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_3_TYPE Thermistor> + #define TEMPERATURE_SENSOR_3_TYPE Thermistor> #define TEMPERATURE_SENSOR_3_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ diff --git a/g2core/settings/settings_Printrbot_Simple_1403.h b/g2core/settings/settings_Printrbot_Simple_1403.h index de04c7c5..ce2f6cc0 100644 --- a/g2core/settings/settings_Printrbot_Simple_1403.h +++ b/g2core/settings/settings_Printrbot_Simple_1403.h @@ -245,7 +245,7 @@ #if HAS_TEMPERATURE_SENSOR_1 #define TEMPERATURE_SENSOR_1_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_1_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_1_TYPE Thermistor> + #define TEMPERATURE_SENSOR_1_TYPE Thermistor> #define TEMPERATURE_SENSOR_1_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ @@ -260,7 +260,7 @@ #if HAS_TEMPERATURE_SENSOR_2 #define TEMPERATURE_SENSOR_2_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_2_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_2_TYPE Thermistor> + #define TEMPERATURE_SENSOR_2_TYPE Thermistor> #define TEMPERATURE_SENSOR_2_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ @@ -275,7 +275,7 @@ #if HAS_TEMPERATURE_SENSOR_3 #define TEMPERATURE_SENSOR_3_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_3_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_3_TYPE Thermistor> + #define TEMPERATURE_SENSOR_3_TYPE Thermistor> #define TEMPERATURE_SENSOR_3_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ diff --git a/g2core/settings/settings_Printrbot_Simple_1608.h b/g2core/settings/settings_Printrbot_Simple_1608.h index bfb3ee40..444971ae 100644 --- a/g2core/settings/settings_Printrbot_Simple_1608.h +++ b/g2core/settings/settings_Printrbot_Simple_1608.h @@ -259,7 +259,7 @@ #if HAS_TEMPERATURE_SENSOR_1 #define TEMPERATURE_SENSOR_1_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_1_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_1_TYPE Thermistor> + #define TEMPERATURE_SENSOR_1_TYPE Thermistor> #define TEMPERATURE_SENSOR_1_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ @@ -274,7 +274,7 @@ #if HAS_TEMPERATURE_SENSOR_2 #define TEMPERATURE_SENSOR_2_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_2_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_2_TYPE Thermistor> + #define TEMPERATURE_SENSOR_2_TYPE Thermistor> #define TEMPERATURE_SENSOR_2_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ @@ -289,7 +289,7 @@ #if HAS_TEMPERATURE_SENSOR_3 #define TEMPERATURE_SENSOR_3_CIRCUIT_TYPE ADCCircuitSimplePullup #define TEMPERATURE_SENSOR_3_CIRCUIT_INIT { /*pullup_resistance:*/ 4700 } - #define TEMPERATURE_SENSOR_3_TYPE Thermistor> + #define TEMPERATURE_SENSOR_3_TYPE Thermistor> #define TEMPERATURE_SENSOR_3_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, \ diff --git a/g2core/settings/settings_Ultimaker_2_Plus.h b/g2core/settings/settings_Ultimaker_2_Plus.h index 350ebeb7..6d89b6a5 100644 --- a/g2core/settings/settings_Ultimaker_2_Plus.h +++ b/g2core/settings/settings_Ultimaker_2_Plus.h @@ -377,7 +377,7 @@ M100.1 ({{ajh:144000.0}}) #if HAS_TEMPERATURE_SENSOR_1 // #define TEMPERATURE_SENSOR_1_CIRCUIT_TYPE ADCCircuitDifferentialPullup // #define TEMPERATURE_SENSOR_1_CIRCUIT_INIT { /*pullup_resistance:*/ 200 } -// #define TEMPERATURE_SENSOR_1_TYPE PT100> +// #define TEMPERATURE_SENSOR_1_TYPE PT100> // #define TEMPERATURE_SENSOR_1_INIT {&temperature_sensor_1_circuit} #define TEMPERATURE_SENSOR_1_CIRCUIT_TYPE ADCCircuitRawResistance @@ -393,7 +393,7 @@ M100.1 ({{ajh:144000.0}}) #if HAS_TEMPERATURE_SENSOR_2 #define TEMPERATURE_SENSOR_2_CIRCUIT_TYPE ADCCircuitDifferentialPullup #define TEMPERATURE_SENSOR_2_CIRCUIT_INIT { /*pullup_resistance:*/ 200 } - #define TEMPERATURE_SENSOR_2_TYPE PT100> + #define TEMPERATURE_SENSOR_2_TYPE PT100> #define TEMPERATURE_SENSOR_2_INIT {&temperature_sensor_2_circuit} // #define TEMPERATURE_SENSOR_2_CIRCUIT_TYPE ADCCircuitRawResistance @@ -408,7 +408,7 @@ M100.1 ({{ajh:144000.0}}) #if HAS_TEMPERATURE_SENSOR_3 // #define TEMPERATURE_SENSOR_3_CIRCUIT_TYPE ADCCircuitDifferentialPullup // #define TEMPERATURE_SENSOR_3_CIRCUIT_INIT { /*pullup_resistance:*/ 200 } -// #define TEMPERATURE_SENSOR_3_TYPE PT100> +// #define TEMPERATURE_SENSOR_3_TYPE PT100> // #define TEMPERATURE_SENSOR_3_INIT {&temperature_sensor_3_circuit} #define TEMPERATURE_SENSOR_3_CIRCUIT_TYPE ADCCircuitRawResistance diff --git a/g2core/settings/settings_ender.h b/g2core/settings/settings_ender.h index 59433e7c..442236cf 100644 --- a/g2core/settings/settings_ender.h +++ b/g2core/settings/settings_ender.h @@ -302,7 +302,7 @@ #define B_ZERO_BACKOFF 2 #define B_JERK_HIGH_SPEED 361108.0 // ~150 million mm/min^3 - + //*** Input / output settings *** //** Temperature Sensors ** @@ -316,13 +316,13 @@ #if HAS_TEMPERATURE_SENSOR_1 // Must choose Thermistor or PT100 #if 1 // 1 if a Thermistor, 0 if a PT100 - #define TEMPERATURE_SENSOR_1_TYPE Thermistor> + #define TEMPERATURE_SENSOR_1_TYPE Thermistor> #define TEMPERATURE_SENSOR_1_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, /*pullup_resistance:*/ 200 \ } #else - // #define TEMPERATURE_SENSOR_1_TYPE PT100> + // #define TEMPERATURE_SENSOR_1_TYPE PT100> // #define TEMPERATURE_SENSOR_1_INIT {/*pullup_resistance:*/ 2000, /*inline_resistance*/0.0} #define TEMPERATURE_SENSOR_1_TYPE PT100> #define TEMPERATURE_SENSOR_1_INIT {/*pullup_resistance:*/ 430, /*inline_resistance*/0, spiBus, spiCSPinMux.getCS(5)} @@ -335,13 +335,13 @@ #define HAS_TEMPERATURE_SENSOR_2 false #if HAS_TEMPERATURE_SENSOR_2 #if 1 // 1 if a Thermistor, 0 if a PT100 - #define TEMPERATURE_SENSOR_2_TYPE Thermistor> + #define TEMPERATURE_SENSOR_2_TYPE Thermistor> #define TEMPERATURE_SENSOR_2_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, /*pullup_resistance:*/ 4700 \ } #else - #define TEMPERATURE_SENSOR_2_TYPE PT100> + #define TEMPERATURE_SENSOR_2_TYPE PT100> #define TEMPERATURE_SENSOR_2_INIT {/*pullup_resistance:*/ 200, /*inline_resistance*/0.0} // #define TEMPERATURE_SENSOR_2_TYPE PT100> // #define TEMPERATURE_SENSOR_2_INIT {/*pullup_resistance:*/ 430, /*inline_resistance*/0, spiBus, spiCSPinMux.getCS(5)} @@ -353,13 +353,13 @@ #define HAS_TEMPERATURE_SENSOR_3 true #if HAS_TEMPERATURE_SENSOR_3 #if 1 // 1 if a Thermistor, 0 if a PT100 - #define TEMPERATURE_SENSOR_3_TYPE Thermistor> + #define TEMPERATURE_SENSOR_3_TYPE Thermistor> #define TEMPERATURE_SENSOR_3_INIT { \ /*T1:*/ 20.0, /*T2:*/ 190.0, /*T3:*/ 255.0, \ /*R1:*/ 144700.0, /*R2:*/ 5190.0, /*R3:*/ 4809.0, /*pullup_resistance:*/ 4700 \ } #else - // #define TEMPERATURE_SENSOR_3_TYPE PT100> + // #define TEMPERATURE_SENSOR_3_TYPE PT100> // #define TEMPERATURE_SENSOR_3_INIT {/*pullup_resistance:*/ 200, /*inline_resistance*/0.0} #define TEMPERATURE_SENSOR_3_TYPE PT100> #define TEMPERATURE_SENSOR_3_INIT {/*pullup_resistance:*/ 430, /*inline_resistance*/0, spiBus, spiCSPinMux.getCS(6)} @@ -491,4 +491,4 @@ #define H3_DEFAULT_D 50 #define H3_DEFAULT_F 0.0015 -#define TEMP_MIN_BED_RISE_DEGREES_OVER_TIME 0.1 \ No newline at end of file +#define TEMP_MIN_BED_RISE_DEGREES_OVER_TIME 0.1 diff --git a/g2core/stepper.cpp b/g2core/stepper.cpp index 079b91f9..25179b32 100644 --- a/g2core/stepper.cpp +++ b/g2core/stepper.cpp @@ -62,13 +62,12 @@ static void _load_move(void) HOT_FUNC; /**** Setup motate ****/ -using namespace Motate; -extern OutputPin debug_pin1; -extern OutputPin debug_pin2; -extern OutputPin debug_pin3; -//extern OutputPin debug_pin4; +extern OutputPin debug_pin1; +extern OutputPin debug_pin2; +extern OutputPin debug_pin3; +//extern OutputPin debug_pin4; -dda_timer_type dda_timer {kTimerUpToMatch, FREQUENCY_DDA}; // stepper pulse generation +dda_timer_type dda_timer {Motate::kTimerUpToMatch, FREQUENCY_DDA}; // stepper pulse generation exec_timer_type exec_timer; // triggers calculation of next+1 stepper segment fwd_plan_timer_type fwd_plan_timer; // triggers planning of next block @@ -126,6 +125,8 @@ http://en.cppreference.com/w/cpp/language/lambda */ void stepper_init() { + using namespace Motate; + memset(&st_run, 0, sizeof(st_run)); // clear all values, pointers and status memset(&st_pre, 0, sizeof(st_pre)); // clear all values, pointers and status stepper_init_assertions(); diff --git a/g2core/temperature.cpp b/g2core/temperature.cpp index 4e7b1cd3..25decdb0 100644 --- a/g2core/temperature.cpp +++ b/g2core/temperature.cpp @@ -53,19 +53,19 @@ #define HAS_TEMPERATURE_SENSOR_3 false #endif #ifndef EXTRUDER_1_OUTPUT_PIN -#define EXTRUDER_1_OUTPUT_PIN kOutput1_PinNumber +#define EXTRUDER_1_OUTPUT_PIN Motate::kOutput1_PinNumber #endif #ifndef EXTRUDER_1_FAN_PIN -#define EXTRUDER_1_FAN_PIN kOutput3_PinNumber +#define EXTRUDER_1_FAN_PIN Motate::kOutput3_PinNumber #endif #ifndef EXTRUDER_2_OUTPUT_PIN -#define EXTRUDER_2_OUTPUT_PIN kOutput2_PinNumber +#define EXTRUDER_2_OUTPUT_PIN Motate::kOutput2_PinNumber #endif #ifndef BED_OUTPUT_PIN -#define BED_OUTPUT_PIN kOutput11_PinNumber +#define BED_OUTPUT_PIN Motate::kOutput11_PinNumber #endif #ifndef BED_OUTPUT_INIT -#define BED_OUTPUT_INIT {kNormal, fet_pin3_freq} +#define BED_OUTPUT_INIT {Motate::kNormal, fet_pin3_freq} // OR //#define BED_OUTPUT_INIT {kPWMPinInverted, fet_pin3_freq}; #endif @@ -125,8 +125,6 @@ /**** Allocate structures ****/ // This makes the Motate:: prefix unnecessary. -using namespace Motate; - /****** Create file-global objects ******/ // The should be set in hardware.h for each board. @@ -314,10 +312,10 @@ struct Thermistor { template Thermistor(const float temp_low, const float temp_med, const float temp_high, const float res_low, const float res_med, const float res_high, const ADCCircuit *_circuit, Ts&&... additional_values) : circuit{_circuit}, - adc_pin{kNormal, [&]{this->adc_has_new_value();}, std::forward(additional_values)...} + adc_pin{Motate::kNormal, [&]{this->adc_has_new_value();}, std::forward(additional_values)...} { setup(temp_low, temp_med, temp_high, res_low, res_med, res_high); - adc_pin.setInterrupts(kPinInterruptOnChange|kInterruptPriorityLow); + adc_pin.setInterrupts(Motate::kPinInterruptOnChange|Motate::kInterruptPriorityLow); adc_pin.setVoltageRange(kSystemVoltage, 0, //get_voltage_of_temp(min_temp), kSystemVoltage, //get_voltage_of_temp(max_temp), @@ -435,9 +433,9 @@ struct PT100 { template PT100(const ADCCircuit *_circuit, Ts&&... additional_values) : circuit{_circuit}, - adc_pin{kNormal, [&](bool e){this->adc_has_new_value(e);}, additional_values...} + adc_pin{Motate::kNormal, [&](bool e){this->adc_has_new_value(e);}, additional_values...} { - adc_pin.setInterrupts(kPinInterruptOnChange|kInterruptPriorityLow); + adc_pin.setInterrupts(Motate::kPinInterruptOnChange|Motate::kInterruptPriorityLow); adc_pin.setVoltageRange(kSystemVoltage, get_voltage_of_temp(min_temp), get_voltage_of_temp(max_temp), @@ -579,7 +577,7 @@ float last_reported_temp3 = 0; // DO_1: Extruder1_PWM const int32_t fet_pin1_freq = 2000; #if TEMPERATURE_OUTPUT_ON == 1 -PWMOutputPin fet_pin1 {kNormal, fet_pin1_freq};// {kPWMPinInverted, fet_pin1_freq}; +PWMOutputPin fet_pin1 {Motate::kNormal, fet_pin1_freq};// {kPWMPinInverted, fet_pin1_freq}; #else PWMOutputPin<-1> fet_pin1;// {kPWMPinInverted}; #endif @@ -587,7 +585,7 @@ PWMOutputPin<-1> fet_pin1;// {kPWMPinInverted}; // DO_2: Extruder2_PWM const int32_t fet_pin2_freq = 2000; #if TEMPERATURE_OUTPUT_ON == 1 -PWMOutputPin fet_pin2 {kNormal, fet_pin2_freq};// {kPWMPinInverted, fet_pin1_freq}; +PWMOutputPin fet_pin2 {Motate::kNormal, fet_pin2_freq};// {kPWMPinInverted, fet_pin1_freq}; #else PWMOutputPin<-1> fet_pin2;// {kPWMPinInverted}; #endif @@ -603,11 +601,11 @@ PWMOutputPin<-1> fet_pin3;// {kPWMPinInverted}; // DO_3: Fan1A_PWM -//PWMOutputPin fan_pin1; +//PWMOutputPin fan_pin1; // DO_4: Fan1B_PWM -//PWMOutputPin fan_pin2; +//PWMOutputPin fan_pin2; // DO_5: Fan2A_PWM -//PWMOutputPin fan_pin3; +//PWMOutputPin fan_pin3; //// We're going to utilize the fet_pin1 PWMOutputPin<>'s timer interrupt to drive the ADC sampling. @@ -616,7 +614,7 @@ PWMOutputPin<-1> fet_pin3;// {kPWMPinInverted}; //#if TEMPERATURE_OUTPUT_ON == 1 //namespace Motate { // template<> -// void PWMOutputPin::parentTimerType::interrupt() { +// void PWMOutputPin::parentTimerType::interrupt() { // if (!--fet_pin1_sample_counter) { // ADC_Module::startSampling(); // fet_pin1_sample_counter = fet_pin1_sample_freq; @@ -630,7 +628,7 @@ PWMOutputPin<-1> fet_pin3;// {kPWMPinInverted}; // We're going to register a SysTick event const int16_t temperature_sample_freq = 10; // every fet_pin1_sample_freq interrupts, sample int16_t temperature_sample_counter = temperature_sample_freq; -SysTickEvent adc_tick_event {[&] { +Motate::SysTickEvent adc_tick_event {[&] { if (!--temperature_sample_counter) { temperature_sensor_1.start_sampling(); temperature_sensor_2.start_sampling(); @@ -861,7 +859,7 @@ void temperature_init() // Register the SysTick event (described above) #if TEMPERATURE_OUTPUT_ON == 1 - SysTickTimer.registerEvent(&adc_tick_event); + Motate::SysTickTimer.registerEvent(&adc_tick_event); #endif temperature_reset(); diff --git a/g2core/util.cpp b/g2core/util.cpp index d1b9e7a1..377fbfbb 100644 --- a/g2core/util.cpp +++ b/g2core/util.cpp @@ -694,7 +694,7 @@ char inttoa(char *str, int n) void LAGER(const char * msg) { char message[64]; - sprintf(message, "%lu: %s\n", SysTickTimer_getValue(), msg); + sprintf(message, "%lu: %s\n", Motate::SysTickTimer.getValue(), msg); xio_writeline(message); } @@ -702,9 +702,9 @@ void LAGER_cm(const char * msg) { char message[64]; if (cm == &cm1) { - sprintf(message, "%lu: p1 %s\n", SysTickTimer_getValue(), msg); + sprintf(message, "%lu: p1 %s\n", Motate::SysTickTimer.getValue(), msg); } else { - sprintf(message, "%lu: p2 %s\n", SysTickTimer_getValue(), msg); + sprintf(message, "%lu: p2 %s\n", Motate::SysTickTimer.getValue(), msg); } xio_writeline(message); }