|
@@ -2,7 +2,7 @@
|
|
|
#include "libs/shark_libs.h"
|
|
#include "libs/shark_libs.h"
|
|
|
#include "spi.h"
|
|
#include "spi.h"
|
|
|
#include "ml5238.h"
|
|
#include "ml5238.h"
|
|
|
-
|
|
|
|
|
|
|
+#include "libs/logger.h"
|
|
|
static int ml5238_read(uint8_t regaddr, uint8_t *data);
|
|
static int ml5238_read(uint8_t regaddr, uint8_t *data);
|
|
|
static void ml5238_clear_bits(uint8_t regaddr, uint8_t bit);
|
|
static void ml5238_clear_bits(uint8_t regaddr, uint8_t bit);
|
|
|
static void ml5238_set_bits(uint8_t regaddr, uint8_t bit);
|
|
static void ml5238_set_bits(uint8_t regaddr, uint8_t bit);
|
|
@@ -27,6 +27,7 @@ int ml5238_charger_is_disconnect(int small_current_on){
|
|
|
uint8_t fet = 0;
|
|
uint8_t fet = 0;
|
|
|
ml5238_read(ML5238_FET, &fet);
|
|
ml5238_read(ML5238_FET, &fet);
|
|
|
ml5238_read(ML5238_PSENSE, &value);
|
|
ml5238_read(ML5238_PSENSE, &value);
|
|
|
|
|
+ sys_error("fet 0x%x, PSENSE 0x%x\n", fet, value);
|
|
|
if ((fet & FET_DF) || small_current_on){
|
|
if ((fet & FET_DF) || small_current_on){
|
|
|
return (value & PSENSE_PSL);
|
|
return (value & PSENSE_PSL);
|
|
|
}
|
|
}
|