diff --git a/firmware/app/comms/i2c.h b/firmware/app/comms/i2c.h index 740b9be..aadc7d8 100644 --- a/firmware/app/comms/i2c.h +++ b/firmware/app/comms/i2c.h @@ -26,9 +26,9 @@ * - there is no ack on address. code always assumes slave is responding. */ #define i2c_init() i2cm_init() -#define i2c_start() { SetSysClock_HSI(HCLK_24MHZ); i2cm_start(); } +#define i2c_start() { /*SetSysClock_HSI(HCLK_24MHZ);*/ i2cm_start(); } #define i2c_restart() i2cm_restart() -#define i2c_stop() { i2cm_stop(); SetSysClock_HSI(HCLK_8MHZ); } +#define i2c_stop() { i2cm_stop(); /*SetSysClock_HSI(HCLK_16MHZ);*/ } #define i2c_rd(ack) i2cm_rd(ack) #define i2c_wr(dat) i2cm_wr(dat) #define i2c_addr(a, w) i2c_start(); i2cm_addr(a, w) diff --git a/firmware/app/comms/soft_i2c_master.c b/firmware/app/comms/soft_i2c_master.c index 8ae476e..8012efd 100644 --- a/firmware/app/comms/soft_i2c_master.c +++ b/firmware/app/comms/soft_i2c_master.c @@ -28,20 +28,20 @@ -#define CYCLES_TO_HI 2 -#define CYCLES_TO_LO 0 +#define CYCLES_TO_HI 1 // was 2 +#define CYCLES_TO_LO 0 // was 0 -//#define CYCLES_RD 2 // cycles spent in read routine -//#define CYCLES_WR_HI 2 // extra cycles spent in write routine +//#define CYCLES_RD 2 // cycles spent in read routine +//#define CYCLES_WR_HI 2 // extra cycles spent in write routine //#define CYCLES_WR_LO 4 -#define bit_delay_hi() { spin = delay_hi; while(spin--); } -#define bit_delay_lo() { spin = delay_lo; while(spin--); } +#define bit_delay_hi() { spin = delay_hi; while(spin--); } +#define bit_delay_lo() { spin = delay_lo; while(spin--); } -#define rd_delay() bit_delay_hi() +#define rd_delay() bit_delay_hi() -#define wr_delay_hi() bit_delay_hi() -#define wr_delay_lo() bit_delay_hi() // spin = delay_hi - CYCLES_EXTRA_WR_HI; while(spin--) +#define wr_delay_hi() bit_delay_hi() +#define wr_delay_lo() bit_delay_hi() // spin = delay_hi - CYCLES_EXTRA_WR_HI; while(spin--) #define SDA_PIN 9 diff --git a/firmware/app/led/matrix.c b/firmware/app/led/matrix.c index e51a33a..a0e2baa 100644 --- a/firmware/app/led/matrix.c +++ b/firmware/app/led/matrix.c @@ -29,7 +29,7 @@ uint8_t awled_fade[AW20X_FADE_COUNT]; static uint8_t led_matrix_needs_update = 0; const LedMap led_map = { - // map is 1-based to match part numbers on the board + // map is 1-based to match LED refdegs on the board .ribbon = { // ribbon 13, 25, 1, 49, 37, 14, @@ -71,6 +71,7 @@ const LedMap led_map = { } }; + LedMap led_set;