Added a commandline parapeter to the meas script to trigger the save default values functionality.
This commit is contained in:
parent
1e4e3d22d8
commit
ac9f77d8d5
2 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
Loading…
Reference in a new issue