diff options
-rw-r--r-- | blinky.c | 2 | ||||
-rw-r--r-- | project.h | 33 | ||||
-rw-r--r-- | prototypes.h | 24 |
3 files changed, 30 insertions, 29 deletions
@@ -28,7 +28,7 @@ map (int j, int n) return j; } -int +static int ramp (int j, int n) { @@ -1,12 +1,38 @@ #define F_CPU 16000000 + +#ifdef PROTOTYPING +#define NOPROTO static +#define inline +//delay.h is broken we need to look after it +#define __OPTIMIZE__ +#else +#define NOPROTO +#endif + + #include <stdio.h> #include <stdint.h> #include <avr/io.h> #include <avr/interrupt.h> #include <avr/pgmspace.h> + +#ifdef PROTOTYPING +#define _delay_ms static _delay_ms +#define _delay_us static _delay_us +#define _delay_loop_1 static _delay_loop_1 +#define _delay_loop_2 static _delay_loop_2 +#endif + #include <util/delay.h> +#ifdef PROTOTYPING +#undef _delay_loop_2 +#undef _delay_loop_1 +#undef _delay_us +#undef _delay_ms +#endif + #include "uart.h" #define UART_BAUD_RATE 115200 @@ -16,13 +42,6 @@ #define WS2812_PIN 1 #include "lib_ws2812.h" - -#ifdef PROTOTYPING -#define NOPROTO static -#else -#define NOPROTO -#endif - #define NOUNUSED __attribute__((unused)) #include "prototypes.h" diff --git a/prototypes.h b/prototypes.h index b578f9c..c461ff9 100644 --- a/prototypes.h +++ b/prototypes.h @@ -1,35 +1,17 @@ /* lib_ws2812.c */ -void _delay_loop_1(uint8_t __count); -void _delay_loop_2(uint16_t __count); -void _delay_ms(double __ms); -void _delay_us(double __us); +void ws2812_setleds(struct RGB *ledarray, uint16_t leds); +void ws2812_setleds_pin(struct RGB *ledarray, uint16_t leds, uint8_t pinmask); void ws2812_sendarray(uint8_t *data, uint16_t datlen); +void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t maskhi); /* blinky.c */ -void _delay_loop_1(uint8_t __count); -void _delay_loop_2(uint16_t __count); -void _delay_ms(double __ms); -void _delay_us(double __us); -int ramp(int j, int n); int main(void); /* util.c */ -void _delay_loop_1(uint8_t __count); -void _delay_loop_2(uint16_t __count); -void _delay_ms(double __ms); -void _delay_us(double __us); void setup_clocks(void); /* uart.c */ -void _delay_loop_1(uint8_t __count); -void _delay_loop_2(uint16_t __count); -void _delay_ms(double __ms); -void _delay_us(double __us); void uart_init(unsigned int baudrate); unsigned int uart_getc(void); void uart_putc(unsigned char data); void uart_puts(const char *s); void uart_puts_p(const char *progmem_s); /* stdio.c */ -void _delay_loop_1(uint8_t __count); -void _delay_loop_2(uint16_t __count); -void _delay_ms(double __ms); -void _delay_us(double __us); void stdio_init(void); |