File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ typedef struct _DriverState
177
177
uint32_t velcontrol ;
178
178
uint32_t ping_request ;
179
179
uint32_t odom_drop ;
180
+ int32_t vsrc_max ;
180
181
} DriverState ;
181
182
182
183
#ifdef static_assert
Original file line number Diff line number Diff line change @@ -711,6 +711,19 @@ int main()
711
711
driver_state .ifmode = 0 ;
712
712
driver_state .watchdog = 0 ;
713
713
driver_state .odom_drop = 0 ;
714
+ driver_state .vsrc_max = 0x3ff ;
715
+ switch (driver_state .board_version )
716
+ {
717
+ case BOARD_R6A :
718
+ case BOARD_R4 :
719
+ break ;
720
+ case BOARD_R6B :
721
+ #if defined(tfrog_rev5 )
722
+ driver_state .vsrc_max = 0x3ff * VSRC_CONV_B ;
723
+ #endif
724
+ break ;
725
+ }
726
+
714
727
// Driver loop
715
728
while (1 )
716
729
{
@@ -1014,7 +1027,7 @@ int main()
1014
1027
driver_state .vsrc = Filter1st_Filter (& voltf , (int32_t )(analog [7 ] & 0x0FFF ));
1015
1028
ADC_Start ();
1016
1029
1017
- if (driver_param .vsrc_rated >= 0x03FF )
1030
+ if (driver_param .vsrc_rated >= driver_state . vsrc_max )
1018
1031
{
1019
1032
driver_state .vsrc_factor = 32768 ;
1020
1033
}
You can’t perform that action at this time.
0 commit comments