Created regulated output
This commit is contained in:
@@ -29,8 +29,25 @@ int main(void)
|
||||
// Read saved config
|
||||
cfg_mem.init();
|
||||
|
||||
#ifdef OVERRIDE_CONFIG
|
||||
cfg_mem.btn_force = 0;
|
||||
cfg_mem.bmode = 0;
|
||||
cfg_mem.pot_mode = 0;
|
||||
cfg_mem.dsp_brigth = 100;
|
||||
cfg_mem.dsp_dimm = 50;
|
||||
cfg_mem.brake_force = 100;
|
||||
cfg_mem.max_hbrake_time = 1000;
|
||||
cfg_mem.lock_current = 4200;
|
||||
cfg_mem.max_out_voltage = 6500;
|
||||
cfg_mem.min_out_voltage = 500;
|
||||
cfg_mem.save_all();
|
||||
#endif
|
||||
|
||||
uint8_t user_force = 0;
|
||||
|
||||
ccout.max_voltage = cfg_mem.max_out_voltage;
|
||||
ccout.min_voltage = cfg_mem.min_out_voltage;
|
||||
|
||||
button_force.force = cfg_mem.btn_force;
|
||||
dccd_force.brake_mode = cfg_mem.bmode;
|
||||
dccd_force.max_hbrake_time = cfg_mem.max_hbrake_time;
|
||||
@@ -56,7 +73,7 @@ int main(void)
|
||||
if((sup_fuse.fault)||(out_fuse.fault)) dccd_force.force = 0;
|
||||
|
||||
// Convert force to current
|
||||
ccout.target = util::percent_of(dccd_force.force, cfg_mem.lock_current);
|
||||
ccout.max_current = util::percent_of(dccd_force.force, cfg_mem.lock_current);
|
||||
|
||||
// Execute outputs
|
||||
ccout.update();
|
||||
|
||||
Reference in New Issue
Block a user