@@ -16,45 +16,49 @@ const int ADC1_CS = 11; // MCP3208. ADC1 in VCR schematic. Used for extra thermi
1616/* -------------------------------------------------- */
1717
1818/* Channels on adc_0 */
19- const int GLV_SENSE_CHANNEL = 0 ;
20- const int CURRENT_SENSE_CHANNEL = 1 ;
21- const int REFERENCE_SENSE_CHANNEL = 2 ;
22- const int RL_LOADCELL_CHANNEL = 3 ;
23- const int RR_LOADCELL_CHANNEL = 4 ;
24- const int RL_SUS_POT_CHANNEL = 5 ;
25- const int RR_SUS_POT_CHANNEL = 6 ;
19+ constexpr int GLV_SENSE_CHANNEL = 0 ;
20+ constexpr int CURRENT_SENSE_CHANNEL = 1 ;
21+ constexpr int REFERENCE_SENSE_CHANNEL = 2 ;
22+ constexpr int RL_LOADCELL_CHANNEL = 3 ;
23+ constexpr int RR_LOADCELL_CHANNEL = 4 ;
24+ constexpr int RL_SUS_POT_CHANNEL = 5 ;
25+ constexpr int RR_SUS_POT_CHANNEL = 6 ;
2626// const int UNUSED_CHANNEL = 7;
2727
2828/* Channels on ADC_1 */
29- const int THERMISTOR_0 = 0 ;
30- const int THERMISTOR_1 = 1 ;
31- const int THERMISTOR_2 = 2 ;
32- const int THERMISTOR_3 = 3 ;
33- const int THERMISTOR_4 = 4 ;
34- const int THERMISTOR_5 = 5 ;
35- const int THERMISTOR_6 = 6 ;
36- const int THERMISTOR_7 = 7 ;
29+ constexpr int THERMISTOR_0 = 0 ;
30+ constexpr int THERMISTOR_1 = 1 ;
31+ constexpr int THERMISTOR_2 = 2 ;
32+ constexpr int THERMISTOR_3 = 3 ;
33+ constexpr int THERMISTOR_4 = 4 ;
34+ constexpr int THERMISTOR_5 = 5 ;
35+ constexpr int THERMISTOR_6 = 6 ;
36+ constexpr int THERMISTOR_7 = 7 ;
3737
3838/* Scaling and offset */
39- const float GLV_SENSE_SCALE = (float )(24.0 /((2.77149877 /3.3 )* 4096.0 )); //unsure about the multiplication by 4.0865
40- const int GLV_SENSE_OFFSET = 0 ; //No offset for GLV
41- const float CURRENT_SENSE_SCALE = (float )(24 /((2.77149877 /3.3 )* 4096 )); //unsure about the multiplication by 4.0865
42- const int CURRENT_SENSE_OFFSET = 0 ; //No offset for CURRENT_SENSE
43- const float REFERENCE_SENSE_SCALE = (float )(24 /((2.77149877 /3.3 )* 4096 )); //unsure about the multiplication by 4.0865
44- const int REFERENCE_SENSE_OFFSET = 0 ; //No offset for REFERENCE_SENSE
39+ constexpr float GLV_SENSE_SCALE = (float )(24.0 /((2.77149877 /3.3 )*4096.0 )); // unsure about the multiplication by 4.0865
40+ constexpr int GLV_SENSE_OFFSET = 0 ; // No offset for GLV
41+ constexpr float CURRENT_SENSE_SCALE = (float )(24 /((2.77149877 /3.3 )*4096 )); // unsure about the multiplication by 4.0865
42+ constexpr int CURRENT_SENSE_OFFSET = 0 ; // No offset for CURRENT_SENSE
43+ constexpr float REFERENCE_SENSE_SCALE = (float )(24 /((2.77149877 /3.3 )*4096 )); // unsure about the multiplication by 4.0865
44+ constexpr int REFERENCE_SENSE_OFFSET = 0 ; // No offset for REFERENCE_SENSE
4545
4646// Values are from the old MCU rev15
47- const float RL_LOADCELL_SCALE = 0.1149f ;
48- const float RL_LOADCELL_OFFSET = 13.526f / RL_LOADCELL_SCALE ;
49- const float RR_LOADCELL_SCALE = 0.118f ;
50- const float RR_LOADCELL_OFFSET = 25.721f / RR_LOADCELL_SCALE ;
47+ constexpr float RL_LOADCELL_SCALE = 0 .1149f ;
48+ constexpr float RL_LOADCELL_OFFSET = 13 .526f / RL_LOADCELL_SCALE;
49+ constexpr float RR_LOADCELL_SCALE = 0 .118f ;
50+ constexpr float RR_LOADCELL_OFFSET = 25 .721f / RR_LOADCELL_SCALE;
5151
5252// does not matter that much
53- const float RL_SUS_POT_SCALE = 1 ;
54- const int RL_SUS_POT_OFFSET = 1 ;
55- const float RR_SUS_POT_SCALE = 1 ;
56- const int RR_SUS_POT_OFFSET = 1 ;
57-
53+ constexpr float RL_SUS_POT_SCALE = 1 ;
54+ constexpr int RL_SUS_POT_OFFSET = 1 ;
55+ constexpr float RR_SUS_POT_SCALE = 1 ;
56+ constexpr int RR_SUS_POT_OFFSET = 1 ;
5857
58+ constexpr int WATCHDOG_PIN = 36 ;
5959
60+ namespace default_system_params
61+ {
62+ constexpr unsigned long KICK_INTERVAL_MS = 10UL ;
63+ }
6064#endif /* VCR_CONSTANTS */
0 commit comments