@@ -17,8 +17,8 @@ npmx_charger_t *charger_instance_get(const struct shell *shell)
1717}
1818
1919static bool charger_charging_current_set_helper (const struct shell * shell ,
20- npmx_charger_t * charger_instance , uint16_t current ,
21- uint16_t * p_charging_current )
20+ npmx_charger_t * charger_instance , uint32_t current ,
21+ uint32_t * p_charging_current )
2222{
2323 npmx_error_t err_code = npmx_charger_charging_current_set (charger_instance , current );
2424 if (!check_error_code (shell , err_code )) {
@@ -58,16 +58,16 @@ static int cmd_charger_charging_current_set(const struct shell *shell, size_t ar
5858 }
5959
6060 if (!range_check (shell , args_info .arg [0 ].result .uvalue ,
61- NPM_BCHARGER_CHARGING_CURRENT_MIN_MA , NPM_BCHARGER_CHARGING_CURRENT_MAX_MA ,
61+ NPM_BCHARGER_CHARGING_CURRENT_MIN_UA , NPM_BCHARGER_CHARGING_CURRENT_MAX_UA ,
6262 "charging current" )) {
6363 return 0 ;
6464 }
6565
66- uint16_t charging_current_ma = (uint16_t )args_info .arg [0 ].result .uvalue ;
67- uint16_t current_actual ;
68- if (charger_charging_current_set_helper (shell , charger_instance , charging_current_ma ,
66+ uint32_t charging_current_ua = (uint32_t )args_info .arg [0 ].result .uvalue ;
67+ uint32_t current_actual ;
68+ if (charger_charging_current_set_helper (shell , charger_instance , charging_current_ua ,
6969 & current_actual )) {
70- print_success (shell , current_actual , UNIT_TYPE_MILLIAMPERE );
70+ print_success (shell , current_actual , UNIT_TYPE_MICROAMPERE );
7171 }
7272 return 0 ;
7373}
@@ -82,15 +82,15 @@ static int cmd_charger_charging_current_get(const struct shell *shell, size_t ar
8282 return 0 ;
8383 }
8484
85- uint16_t charging_current_ma ;
85+ uint32_t charging_current_ua ;
8686 npmx_error_t err_code =
87- npmx_charger_charging_current_get (charger_instance , & charging_current_ma );
87+ npmx_charger_charging_current_get (charger_instance , & charging_current_ua );
8888 if (!check_error_code (shell , err_code )) {
8989 print_get_error (shell , "charging current" );
9090 return 0 ;
9191 }
9292
93- print_value (shell , charging_current_ma , UNIT_TYPE_MILLIAMPERE );
93+ print_value (shell , charging_current_ua , UNIT_TYPE_MICROAMPERE );
9494 return 0 ;
9595}
9696
@@ -270,8 +270,7 @@ static int cmd_charger_discharging_current_set(const struct shell *shell, size_t
270270
271271 const uint16_t allowed_values [] = NPM_BCHARGER_DISCHARGING_CURRENTS_MA ;
272272 int32_t allowed_min = allowed_values [0 ];
273- int32_t allowed_max = ARRAY_SIZE (allowed_values ) > 1 ?
274- allowed_values [ARRAY_SIZE (allowed_values ) - 1 ] : allowed_values [0 ];
273+ int32_t allowed_max = allowed_values [ARRAY_SIZE (allowed_values ) - 1 ];
275274
276275 if (!range_check (shell , args_info .arg [0 ].result .uvalue ,
277276 allowed_min , allowed_max , "discharging current" )) {
0 commit comments