File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -331,7 +331,6 @@ float PMICClass::getInputVoltageLimit(void) {
331
331
* Return : 0 on Error, 1 on Success
332
332
*******************************************************************************/
333
333
bool PMICClass::setInputCurrentLimit (float current) {
334
-
335
334
int DATA = readRegister (INPUT_SOURCE_REGISTER);
336
335
337
336
if (DATA == -1 ) {
@@ -341,25 +340,25 @@ bool PMICClass::setInputCurrentLimit(float current) {
341
340
byte mask = DATA & 0xF8 ;
342
341
byte current_val = CURRENT_LIM_100;
343
342
344
- if (current > 0.015 ) {
343
+ if (current > 0 .015f ) {
345
344
current_val = CURRENT_LIM_150;
346
345
}
347
- if (current >= 0.5 ) {
346
+ if (current >= 0 .500f ) {
348
347
current_val = CURRENT_LIM_500;
349
348
}
350
- if (current >= CURRENT_LIM_900 ) {
349
+ if (current >= 0 . 900f ) {
351
350
current_val = CURRENT_LIM_900;
352
351
}
353
- if (current >= 1.2 ) {
352
+ if (current >= 1 .200f ) {
354
353
current_val = CURRENT_LIM_1200;
355
354
}
356
- if (current >= 1.5 ) {
355
+ if (current >= 1 .500f ) {
357
356
current_val = CURRENT_LIM_1500;
358
357
}
359
- if (current >= 2.0 ) {
358
+ if (current >= 2 .000f ) {
360
359
current_val = CURRENT_LIM_2000;
361
360
}
362
- if (current >= 3.0 ) {
361
+ if (current >= 3 .000f ) {
363
362
current_val = CURRENT_LIM_3000;
364
363
}
365
364
return writeRegister (INPUT_SOURCE_REGISTER, (mask | current_val));
You can’t perform that action at this time.
0 commit comments