diff --git a/README.md b/README.md index 79d150add3bc01cb515cf9d1d841c3a81fd2641d..1ba0b64662c5e1b0f26f89cf342b2a9a52067d58 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ $ nix-shell nix/shell.nix ## How to build and flash +Select the right firmware for your hardware in`./revision_config.h` by (un)commenting your (un)desired revision(s) (default: rev4). + Standard ESP-IDF project machinery present and working. You can run `idf.py` from the git checkout and things should just work. ### Building diff --git a/components/badge23/leds.c b/components/badge23/leds.c index 7f8d09ea15584f7a9f0857bb6ad3af7646159d76..daedb30bd932a69454e60cbe48d75a5fe4030192 100644 --- a/components/badge23/leds.c +++ b/components/badge23/leds.c @@ -162,12 +162,11 @@ static int setupSPI() return ret; } -static void set_single_led(uint8_t index, uint8_t[3] c){ +void set_single_led(uint8_t index, uint8_t c[3]){ setPixel(&leds, index, c); } static void _leds_init() { - leds_queue = xQueueCreate(10, sizeof(leds_cfg_t)); memset(active_leds, 0 , sizeof(active_leds)); setupSPI(); @@ -191,47 +190,6 @@ led_strip_t *led_strip_init(uint8_t channel, uint8_t gpio, uint16_t led_num); #define LED_GPIO_NUM 14 #define LED_RMT_CHAN 0 -#if 0 -//ESP-IDF 5.0 for reference -led_strip_handle_t led_strip; - -/* LED strip initialization with the GPIO and pixels number*/ -led_strip_config_t strip_config = { - .strip_gpio_num = 14, // The GPIO that connected to the LED strip's data line - .max_leds = 40, // The number of LEDs in the strip, - .led_pixel_format = LED_PIXEL_FORMAT_GRB, // Pixel format of your LED strip - .led_model = LED_MODEL_WS2812, // LED strip model - .flags.invert_out = false, // whether to invert the output signal (useful when your hardware has a level inverter) -}; - -led_strip_rmt_config_t rmt_config = { - .clk_src = RMT_CLK_SRC_DEFAULT, // different clock source can lead to different power consumption - .resolution_hz = 10 * 1000 * 1000, // 10MHz - .flags.with_dma = true, // whether to enable the DMA feature -}; - -static void renderLEDs() -{ - ESP_ERROR_CHECK(led_strip_refresh(led_strip)); - -} - -void set_single_led(int led, uint8_t c[3]) -{ - led = ((39-led) + 1 + 32)%40; - ESP_ERROR_CHECK(led_strip_set_pixel(led_strip, led, c[0], c[1], c[2])); -} - -static void _leds_init() { - memset(active_leds, 0 , sizeof(active_leds)); - - ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip)); - - TaskHandle_t handle; - xTaskCreate(&leds_task, "LEDs player", 4096, NULL, configMAX_PRIORITIES - 2, &handle); -} -#endif - led_strip_t * led_strip; static void _leds_init(){ diff --git a/components/badge23/spio.c b/components/badge23/spio.c index 4dca5c3612acfc7b934f7c247e4bd57e17cd4f2e..8858cf0ab07124b20b4a466721c2c98191b726a2 100644 --- a/components/badge23/spio.c +++ b/components/badge23/spio.c @@ -6,8 +6,6 @@ static int8_t leftbutton = 0; static int8_t rightbutton = 0; -typedef - #ifdef HARDWARE_REVISION_01 #define RIGHT_BUTTON_LEFT 37 @@ -91,7 +89,7 @@ static void _init_buttons(){ cfg.pin_bit_mask = 1; cfg.pull_up_en = GPIO_PULLUP_DISABLE; ESP_ERROR_CHECK(gpio_config(&cfg)); - printf("nya"); + printf("nya\n"); } void update_button_state(){