Commit 2fc408e8 authored by schneider's avatar schneider Committed by Rahix
Browse files

fix(leds): Use new portexpander API

parent 1d0f82b3
#include "gpio.h"
#include "portexpander.h"
#include <stdint.h>
#include <string.h>
......@@ -204,6 +205,14 @@ void leds_init(void)
leds[i][3] = 8;
}
if(portexpander_detected()) {
// Turn on LEDs
// TODO: only turn on LEDs if value != 0,0,0 && dim > 0
portexpander_set(0, 0);
portexpander_set(1, 0);
portexpander_set(2, 0);
}
leds_update();
}
......
......@@ -41,12 +41,6 @@ void portexpander_init(void)
command[0] = 0x01;
command[1] = output_state;
I2C_MasterWrite(MXC_I2C1_BUS0, addr << 1, command, 2, 0);
// Turn on LEDs
// TODO: only turn on LEDs if value != 0,0,0 && dim > 0
command[0] = 0x01;
command[1] = 0x90;
I2C_MasterWrite(MXC_I2C1_BUS0, addr << 1, command, 2, 0);
}
uint8_t portexpander_get(void)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment