diff --git a/firmware/command_ctrl.ino b/firmware/command_ctrl.ino index 1a9aaad..deadb70 100644 --- a/firmware/command_ctrl.ino +++ b/firmware/command_ctrl.ino @@ -373,11 +373,11 @@ void cc_disableClk(void) void cc_saveDefaults(void) { - Serial.write(MSG_SOM1); - Serial.write(MSG_SOM2); saveEEPValues(); + Serial.write(MSG_SOM1); + Serial.write(MSG_SOM2); Serial.write(MSG_TYPE_ANSWER_OK); Serial.write(MSG_EOM1); Serial.write(MSG_EOM2); diff --git a/tools/meas.py b/tools/meas.py index 0fafb42..089bbc5 100644 --- a/tools/meas.py +++ b/tools/meas.py @@ -33,6 +33,8 @@ parser.add_argument("-o", "--output_file", type=str, help="") parser.add_argument("-g", "--show_graph", default=False, help="", action='store_true') # get config parser.add_argument("-c", "--get_config", default=False, help="", action='store_true') +# save default config +parser.add_argument("-S", "--save_config", default=False, help="", action='store_true') ############################################################################### @@ -60,6 +62,7 @@ CC_CMD_SET_DRIVE_STRENGTH = 0x04 CC_CMD_SET_FREQ_STEP = 0x05 CC_CMD_START_MEASUREMENT = 0x06 CC_CMD_GET_CONFIG = 0x10 +CC_CMD_SAV_DFLT = 0x22 ############################################################################### @@ -451,6 +454,11 @@ if __name__ == "__main__": sendSerialData([CC_CMD_GET_CONFIG]) dataSend = dataSend + 1 + if args.save_config == True: + print "Save default configuration values..." + sendSerialData([CC_CMD_SAV_DFLT]) + dataSend = dataSend + 1 + # 4. start main loop while dataSend > 0 and timeout < TIMEOUT_CNT_MAX: