From a1aa8460506951c320097ac98bb702b11ebff32c Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Wed, 12 Mar 2014 23:46:14 +0100 Subject: [PATCH] fixed stuff in ledcontroller.c --- ledcontroller.c | 62 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/ledcontroller.c b/ledcontroller.c index c606da5..1a5c689 100644 --- a/ledcontroller.c +++ b/ledcontroller.c @@ -18,13 +18,14 @@ #include "ledcontroller.h" #include +#include #define NUM_LED1642GW_ICs (3) #define NUM_LED1642GW_CHANNELS (16) -#define NUM_CHANNELS (NUM_LED1642GW_CHANNELS*NUM_LED1642GW_ICs) +#define NUM_LED_CHANNELS (NUM_LED1642GW_CHANNELS*NUM_LED1642GW_ICs) -static uint16_t ledbuffer[NUM_CHANNELS]; +static uint16_t ledbuffer[NUM_LED_CHANNELS]; static int8_t map_lednum_to_channels(uint8_t lednum, uint8_t *channel_r, uint8_t *channel_g, uint8_t *channel_b) { @@ -53,6 +54,7 @@ static int8_t map_lednum_to_channels(uint8_t lednum, uint8_t *channel_r, uint8_t return ret; } +#if 0 static void write_data(uint16_t data, uint8_t le_clocks) { PORTC &= ~(1<=le_clocks; bit--) { if(data&mask) { PORTC |= (1<>= 1; + PORTC &= ~(1<=0; bit--) { if(data&mask) { PORTC |= (1<>= 1; PORTC &= ~(1<=le_clocks; bit--) { + PORTC &= ~(1<>= 1; } + + PORTC |= (1<=0; bit--) { + PORTC &= ~(1<>= 1; + } + + PORTC &= ~(1<