Skip to content

Commit 3b3612c

Browse files
committed
esp8266: Make neopixel support configurable.
To save iRAM.
1 parent dc43508 commit 3b3612c

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

esp8266/espneopixel.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// ESP8266 work for the NeoPixelBus library: github.com/Makuna/NeoPixelBus
66
// Needs to be a separate .c file to enforce ICACHE_RAM_ATTR execution.
77

8+
#include "py/mpconfig.h"
9+
#if MICROPY_ESP8266_NEOPIXEL
10+
811
#include "c_types.h"
912
#include "eagle_soc.h"
1013
#include "user_interface.h"
@@ -58,3 +61,5 @@ void /*ICACHE_RAM_ATTR*/ esp_neopixel_write(uint8_t pin, uint8_t *pixels, uint32
5861
while((mp_hal_ticks_cpu() - startTime) < period); // Wait for last bit
5962
mp_hal_quiet_timing_exit(irq_state);
6063
}
64+
65+
#endif // MICROPY_ESP8266_NEOPIXEL

esp8266/modesp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,9 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = {
710710
{ MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&esp_socket_type },
711711
{ MP_OBJ_NEW_QSTR(MP_QSTR_getaddrinfo), (mp_obj_t)&esp_getaddrinfo_obj },
712712
#endif
713+
#if MICROPY_ESP8266_NEOPIXEL
713714
{ MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write), (mp_obj_t)&esp_neopixel_write_obj },
715+
#endif
714716
#if MICROPY_ESP8266_APA102
715717
{ MP_OBJ_NEW_QSTR(MP_QSTR_apa102_write), (mp_obj_t)&esp_apa102_write_obj },
716718
#endif

esp8266/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
#define MICROPY_FSUSERMOUNT (1)
9292
#define MICROPY_VFS_FAT (1)
9393
#define MICROPY_ESP8266_APA102 (1)
94+
#define MICROPY_ESP8266_NEOPIXEL (1)
9495

9596
#define MICROPY_EVENT_POLL_HOOK {ets_event_poll();}
9697
#define MICROPY_VM_HOOK_COUNT (10)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy