Reduce smbus speed to 50 KHz
This commit is contained in:
parent
7b30477009
commit
285e9bc437
@ -56,7 +56,7 @@ void ac_adapter() {
|
||||
static struct Gpio __code ACIN_N = GPIO(B, 6);
|
||||
static struct Gpio __code LED_ACIN = GPIO(C, 7);
|
||||
|
||||
static bool last = false;
|
||||
static bool last = true;
|
||||
|
||||
// Check if the adapter line goes low
|
||||
bool new = gpio_get(&ACIN_N);
|
||||
@ -68,9 +68,12 @@ void ac_adapter() {
|
||||
printf("Power adapter ");
|
||||
if (new) {
|
||||
printf("unplugged\n");
|
||||
battery_charger_disable();
|
||||
} else {
|
||||
printf("plugged in\n");
|
||||
battery_charger_enable();
|
||||
}
|
||||
battery_debug();
|
||||
}
|
||||
|
||||
last = new;
|
||||
|
@ -9,8 +9,8 @@ void smbus_init(void) {
|
||||
SMB45P3USL = 0x5C;
|
||||
SMB45P3USH = 0x01;
|
||||
|
||||
// Clock to 400 KHz
|
||||
SCLKTSA = 3;
|
||||
// Clock to 50 KHz
|
||||
SCLKTSA = 1;
|
||||
|
||||
// Enable host interface
|
||||
HOCTL2A = 1 << 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user