mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-20 22:14:34 +08:00
Merge remote-tracking branch 'origin/sam_config_fix' into devel
This commit is contained in:
@@ -123,6 +123,7 @@ const Endpoint endpoints[] = {
|
||||
Endpoint::make_object("config"),
|
||||
Endpoint::make_property("brake_resistance", &brake_resistance),
|
||||
Endpoint::close_tree(),
|
||||
Endpoint::make_property("user_config_loaded", const_cast<const bool *>(&user_config_loaded)),
|
||||
Endpoint::make_object("axis0"),
|
||||
Endpoint::make_object("config"),
|
||||
Endpoint::make_property("enable_control_at_start", &axis_configs[0].enable_control_at_start),
|
||||
|
||||
@@ -212,6 +212,7 @@ void get_motor_config(const Motor_t* motor, MotorConfig_t* config) {
|
||||
config->encoder_motor_dir = motor->encoder.motor_dir;
|
||||
}
|
||||
|
||||
bool user_config_loaded = false;
|
||||
|
||||
void init_configuration(void) {
|
||||
MotorConfig_t motor_config[2];
|
||||
@@ -230,11 +231,11 @@ void init_configuration(void) {
|
||||
// Default config coming from flashed Motor_t
|
||||
return;
|
||||
} else {
|
||||
user_config_loaded = true;
|
||||
//printf("load config successful\r\n"); osDelay(5);
|
||||
set_motor_config(&motor_config[0], &motors[0]);
|
||||
set_motor_config(&motor_config[1], &motors[1]);
|
||||
}
|
||||
|
||||
set_motor_config(&motor_config[0], &motors[0]);
|
||||
set_motor_config(&motor_config[1], &motors[1]);
|
||||
}
|
||||
|
||||
void save_configuration(void) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern bool user_config_loaded;
|
||||
void init_configuration(void);
|
||||
void save_configuration(void);
|
||||
void erase_configuration(void);
|
||||
|
||||
Reference in New Issue
Block a user