@@ -22,7 +22,7 @@ namespace VCFInterfaceConstants {
2222 constexpr int BTN_PRESET_READ = 28 ; // Pedals recal button (brightness control on schematic)
2323
2424 constexpr int NEOPIXEL_CONTROL_PIN = 33 ;
25- constexpr int NEOPIXEL_COUNT = 12 ; // 12 neopixeles on dashboard
25+ constexpr int NEOPIXEL_COUNT = 16 ; // 16 neopixeles on dashboard
2626
2727 // watchdog pins
2828 constexpr int WATCHDOG_PIN = 36 ;
@@ -101,6 +101,15 @@ namespace VCFInterfaceConstants {
101101 constexpr float BRAKE_PRESSURE_REAR_SCALE = 1.0 ;
102102 constexpr float BRAKE_PRESSURE_REAR_OFFSET = 0 ;
103103
104+ /* VCF CAN Constants */
105+ constexpr uint32_t TELEM_CAN_BAUDRATE = 1000000 ; // 1 000 000 = 1 Mbit/s
106+ constexpr uint32_t FAUX_CAN_BAUDRATE = 500000 ; // 500 000 = 500 Kbit/s
107+ }
108+
109+ // calibration and processing constants
110+ namespace VCFSystemConstants {
111+ constexpr float LBS_TO_NEWTONS = 4.4482216153 ;
112+
104113 // EEPROM addresses for min and max calibration values
105114 constexpr uint32_t ACCEL_1_MIN_ADDR = 0 ;
106115 constexpr uint32_t ACCEL_2_MIN_ADDR = 4 ;
@@ -125,11 +134,6 @@ namespace VCFInterfaceConstants {
125134 constexpr uint32_t BRAKE_MAX_SENSOR_PEDAL_2 = 4000 ;
126135 constexpr float BRAKE_DEADZONE_MARGIN = 0 .04f ;
127136 constexpr float BRAKE_MECHANICAL_ACTIVATION_PERCENTAGE = 0 .5f ;
128- }
129-
130- // calibration and processing constants
131- namespace VCFSystemConstants {
132- constexpr float LBS_TO_NEWTONS = 4.4482216153 ;
133137
134138 // Steering System Constants
135139 constexpr uint32_t MIN_STEERING_SIGNAL_ANALOG_ADDR = 56 ; // Raw ADC value from analog sensor at minimum (left) steering angle (calibration) TODO: test and find real values for min&max
@@ -167,38 +171,38 @@ namespace VCFTaskConstants {
167171 constexpr unsigned long CAN_SEND_PRIORITY = 10 ;
168172 constexpr unsigned long CAN_SEND_PERIOD = 2000 ; // 2 000 us = 500 Hz
169173
174+ constexpr unsigned long PEDALS_PRIORITY = 5 ;
170175 constexpr unsigned long PEDALS_SEND_PERIOD = 4000 ; // 4 000 us = 250 Hz
171176 constexpr unsigned long PEDALS_SAMPLE_PERIOD = 500 ; // 500 us = 2 kHz
172- constexpr unsigned long PEDALS_PRIORITY = 5 ;
173177
174- constexpr unsigned long BUZZER_WRITE_PERIOD = 100000 ; // 100 000 us = 10 Hz
175178 constexpr unsigned long BUZZER_PRIORITY = 20 ;
179+ constexpr unsigned long BUZZER_WRITE_PERIOD = 100000 ; // 100 000 us = 10 Hz
176180
177- constexpr unsigned long DASH_SAMPLE_PERIOD = 100000 ; // 100 000 us = 10 Hz
178181 constexpr unsigned long DASH_SAMPLE_PRIORITY = 21 ;
182+ constexpr unsigned long DASH_SAMPLE_PERIOD = 100000 ; // 100 000 us = 10 Hz
179183
180- constexpr unsigned long DASH_SEND_PERIOD = 100000 ; // 100 000 us = 10 Hz
181184 constexpr unsigned long DASH_SEND_PRIORITY = 7 ;
185+ constexpr unsigned long DASH_SEND_PERIOD = 100000 ; // 100 000 us = 10 Hz
182186
183187 constexpr unsigned long DEBUG_PRIORITY = 100 ;
184188 constexpr unsigned long DEBUG_PERIOD = 10000 ; // 10 000 us = 2 Hz
185189
186190 constexpr unsigned long NEOPIXEL_UPDATE_PRIORITY = 90 ;
187191 constexpr unsigned long NEOPIXEL_UPDATE_PERIOD = 100000 ; // 100 000 us = 10 Hz
188192
189- constexpr unsigned long STEERING_SEND_PERIOD = 4000 ; // 4 000 us = 250 Hz
190193 constexpr unsigned long STEERING_SEND_PRIORITY = 25 ;
194+ constexpr unsigned long STEERING_SEND_PERIOD = 4000 ; // 4 000 us = 250 Hz
195+
191196 constexpr unsigned long STEERING_SAMPLE_PERIOD = 1000 ; // 2000 us = 500 Hz
192197 constexpr unsigned long STEERING_SAMPLE_PRIORITY = 10 ;
193198
194- constexpr unsigned long LOADCELL_SAMPLE_PERIOD = 250 ; // 250 us = 4 kHz
195199 constexpr unsigned long LOADCELL_SAMPLE_PRIORITY = 24 ;
200+ constexpr unsigned long LOADCELL_SAMPLE_PERIOD = 250 ; // 250 us = 4 kHz
201+ constexpr unsigned long LOADCELL_SEND_PRIORITY = 25 ;
202+ constexpr unsigned long LOADCELL_SEND_PERIOD = 4000 ; // 4 000 us = 250 Hz
196203
197- constexpr unsigned long ETHERNET_SEND_PERIOD = 100000 ; // 100 000 us = 10Hz
198204 constexpr unsigned long ETHERNET_SEND_PRIORITY = 20 ;
199-
200- constexpr unsigned long LOADCELL_SEND_PERIOD = 4000 ; // 4 000 us = 250 Hz
201- constexpr unsigned long LOADCELL_SEND_PRIORITY = 25 ;
205+ constexpr unsigned long ETHERNET_SEND_PERIOD = 100000 ; // 100 000 us = 10Hz
202206
203207 constexpr unsigned long PEDALS_RECALIBRATION_PRIORITY = 150 ;
204208 constexpr unsigned long PEDALS_RECALIBRATION_PERIOD = 100000 ; // 100 000 us = 10 Hz
0 commit comments