1 /* 2 * Copyright (c) 2017 Oticon A/S 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #include <math.h> 7 #include <string.h> 8 #include <strings.h> 9 #include "NRF_hw_args.h" 10 #include "bs_types.h" 11 12 static nrf_hw_sub_args_t *args_g_hw; 13 nrf_hw_sub_cmline_set_defaults(nrf_hw_sub_args_t * args)14void nrf_hw_sub_cmline_set_defaults(nrf_hw_sub_args_t *args){ 15 args->useRealAES = 0; 16 args_g_hw = args; 17 } 18 19 extern void trivial_xo_set_toffset(bs_time_t t_off); 20 extern void trivial_xo_set_drift(double xo_d); 21 22 double nrfhw_start_of; nrf_hw_cmd_starto_found(char * argv,int offset)23void nrf_hw_cmd_starto_found(char * argv, int offset){ 24 args_g_hw->start_offset = nrfhw_start_of; 25 trivial_xo_set_toffset(args_g_hw->start_offset); 26 } 27 28 double nrfhw_drift; nrf_hw_cmd_drift_found(char * argv,int offset)29void nrf_hw_cmd_drift_found(char * argv, int offset){ 30 args_g_hw->xo_drift = nrfhw_drift; 31 trivial_xo_set_drift(args_g_hw->xo_drift); 32 } 33 34 bool nrfhw_useRealAES; nrf_hw_cmd_useRealAES_found(char * argv,int offset)35void nrf_hw_cmd_useRealAES_found(char * argv, int offset){ 36 args_g_hw->useRealAES = nrfhw_useRealAES; 37 } 38