@@ -88,35 +88,35 @@ static int cmd_battery(const struct shell *sh, size_t argc, char **argv)
88
88
return err ;
89
89
}
90
90
91
- shell_fprintf (sh , SHELL_NORMAL , "Temp: %.1d.%02d C\n" , temp . val1 ,
92
- temp .val2 / 10000 );
93
- shell_fprintf (sh , SHELL_NORMAL , "V: %5d.%02d V\n" , volt . val1 ,
94
- volt .val2 / 10000 );
95
- shell_fprintf (sh , SHELL_NORMAL , "V-desired: %d.%02d V\n " ,
96
- v_desired .val1 , v_desired .val2 / 10000 );
97
- shell_fprintf (sh , SHELL_NORMAL , "I: %d mA" , current .val1 );
91
+ shell_print (sh , "Temp: %.1d.%02d C" ,
92
+ temp . val1 , temp .val2 / 10000 );
93
+ shell_print (sh , "V: %5d.%02d V" ,
94
+ volt . val1 , volt .val2 / 10000 );
95
+ shell_print (sh , "V-desired: %d.%02d V" ,
96
+ v_desired .val1 , v_desired .val2 / 10000 );
97
+ shell_fprintf_normal (sh , "I: %d mA" , current .val1 );
98
98
if (current .val1 > 0 ) {
99
- shell_fprintf (sh , SHELL_NORMAL , " (CHG)" );
99
+ shell_fprintf_normal (sh , " (CHG)" );
100
100
} else if (current .val1 < 0 ) {
101
- shell_fprintf (sh , SHELL_NORMAL , " (DISCHG)" );
101
+ shell_fprintf_normal (sh , " (DISCHG)" );
102
102
}
103
- shell_fprintf (sh , SHELL_NORMAL , "\n" );
104
- shell_fprintf (sh , SHELL_NORMAL , "I-desired: %5d mA\n " ,
105
- i_desired .val1 );
103
+ shell_fprintf_normal (sh , "\n" );
104
+ shell_print (sh , "I-desired: %5d mA" ,
105
+ i_desired .val1 );
106
106
allowed = i_desired .val1 && v_desired .val2 && charge .val1 < 100 ;
107
- shell_fprintf (sh , SHELL_NORMAL , "Charging: %sAllowed\n " ,
108
- allowed ? "" : "Not " );
109
- shell_fprintf (sh , SHELL_NORMAL , "Charge: %d %%\n " , charge .val1 );
110
- shell_fprintf (sh , SHELL_NORMAL , "V-design: %d.%02d V\n " ,
111
- v_design .val1 , v_design .val2 / 10000 );
112
- shell_fprintf (sh , SHELL_NORMAL , "Remaining: %d mA\n " ,
113
- charge_remain .val1 );
114
- shell_fprintf (sh , SHELL_NORMAL , "Cap-full: %d mA\n " , cap .val1 );
115
- shell_fprintf (sh , SHELL_NORMAL , "Design: %d mA\n " , nom_cap .val1 );
116
- shell_fprintf (sh , SHELL_NORMAL , "Time full: %dh:%02d\n " ,
117
- full .val1 / 60 , full .val1 % 60 );
118
- shell_fprintf (sh , SHELL_NORMAL , "Time empty: %dh:%02d\n " ,
119
- empty .val1 / 60 , empty .val1 % 60 );
107
+ shell_print (sh , "Charging: %sAllowed" ,
108
+ allowed ? "" : "Not " );
109
+ shell_print (sh , "Charge: %d %%" , charge .val1 );
110
+ shell_print (sh , "V-design: %d.%02d V" ,
111
+ v_design .val1 , v_design .val2 / 10000 );
112
+ shell_print (sh , "Remaining: %d mA" ,
113
+ charge_remain .val1 );
114
+ shell_print (sh , "Cap-full: %d mA" , cap .val1 );
115
+ shell_print (sh , "Design: %d mA" , nom_cap .val1 );
116
+ shell_print (sh , "Time full: %dh:%02d" ,
117
+ full .val1 / 60 , full .val1 % 60 );
118
+ shell_print (sh , "Time empty: %dh:%02d" ,
119
+ empty .val1 / 60 , empty .val1 % 60 );
120
120
121
121
return 0 ;
122
122
}
0 commit comments