forked from bbulkow/FastLED-idf
Fixed lots of warnings
This commit is contained in:
@ -31,3 +31,9 @@ idf_component_register(
|
|||||||
esp_rom
|
esp_rom
|
||||||
driver
|
driver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_compile_options(${COMPONENT_TARGET}
|
||||||
|
PUBLIC
|
||||||
|
-DCONFIG_RMT_SUPPRESS_DEPRECATE_WARN
|
||||||
|
-Wno-volatile
|
||||||
|
)
|
||||||
|
@ -52,7 +52,7 @@ static bool gInitialized = false;
|
|||||||
DRAM_ATTR char g_memorybuf[MEMORYBUF_SIZE] = {0};
|
DRAM_ATTR char g_memorybuf[MEMORYBUF_SIZE] = {0};
|
||||||
DRAM_ATTR char *g_memorybuf_write = g_memorybuf;
|
DRAM_ATTR char *g_memorybuf_write = g_memorybuf;
|
||||||
|
|
||||||
void IRAM_ATTR memorybuf_add( char *b ) {
|
void memorybuf_add( char *b ) {
|
||||||
|
|
||||||
int buflen = strlen(b);
|
int buflen = strlen(b);
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ void IRAM_ATTR memorybuf_add( char *b ) {
|
|||||||
g_memorybuf_write += buflen;
|
g_memorybuf_write += buflen;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRAM_ATTR memorybuf_add( char c ) {
|
void memorybuf_add( char c ) {
|
||||||
|
|
||||||
// don't overflow
|
// don't overflow
|
||||||
int bufRemain = sizeof(g_memorybuf) - ( g_memorybuf_write - g_memorybuf );
|
int bufRemain = sizeof(g_memorybuf) - ( g_memorybuf_write - g_memorybuf );
|
||||||
@ -75,7 +75,7 @@ void IRAM_ATTR memorybuf_add( char c ) {
|
|||||||
g_memorybuf_write++;
|
g_memorybuf_write++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRAM_ATTR memorybuf_insert( char *b, int buflen ) {
|
void memorybuf_insert( char *b, int buflen ) {
|
||||||
// don't overflow
|
// don't overflow
|
||||||
int maxbuf = sizeof(g_memorybuf) - ( g_memorybuf_write - g_memorybuf );
|
int maxbuf = sizeof(g_memorybuf) - ( g_memorybuf_write - g_memorybuf );
|
||||||
if ( maxbuf == 0 ) return;
|
if ( maxbuf == 0 ) return;
|
||||||
@ -86,7 +86,7 @@ void IRAM_ATTR memorybuf_insert( char *b, int buflen ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// often one wants a separator and an integer, do a helper
|
// often one wants a separator and an integer, do a helper
|
||||||
void IRAM_ATTR memorybuf_int( int i, char sep) {
|
void memorybuf_int( int i, char sep) {
|
||||||
|
|
||||||
// am I full already?
|
// am I full already?
|
||||||
int maxbuf = sizeof(g_memorybuf) - ( g_memorybuf_write - g_memorybuf );
|
int maxbuf = sizeof(g_memorybuf) - ( g_memorybuf_write - g_memorybuf );
|
||||||
@ -531,7 +531,7 @@ void ESP32RMTController::doneOnChannel(int channel, void * arg)
|
|||||||
// This interrupt handler handles two cases: a controller is
|
// This interrupt handler handles two cases: a controller is
|
||||||
// done writing its data, or a controller needs to fill the
|
// done writing its data, or a controller needs to fill the
|
||||||
// next half of the RMT buffer with data.
|
// next half of the RMT buffer with data.
|
||||||
void IRAM_ATTR ESP32RMTController::interruptHandler(void *arg)
|
void ESP32RMTController::interruptHandler(void *arg)
|
||||||
{
|
{
|
||||||
|
|
||||||
// -- The basic structure of this code is borrowed from the
|
// -- The basic structure of this code is borrowed from the
|
||||||
@ -577,7 +577,7 @@ DRAM_ATTR char g_bail_str[] = "_BAIL_";
|
|||||||
//
|
//
|
||||||
// returns true if the timing is OK, false if bad
|
// returns true if the timing is OK, false if bad
|
||||||
|
|
||||||
bool IRAM_ATTR ESP32RMTController::timingOk() {
|
bool ESP32RMTController::timingOk() {
|
||||||
|
|
||||||
// last time is always delayed, don't check that one
|
// last time is always delayed, don't check that one
|
||||||
if (mCur >= mSize) return(true);
|
if (mCur >= mSize) return(true);
|
||||||
@ -626,7 +626,7 @@ bool IRAM_ATTR ESP32RMTController::timingOk() {
|
|||||||
// Puts 32 bits of pixel data into the next 32 slots in the RMT memory
|
// Puts 32 bits of pixel data into the next 32 slots in the RMT memory
|
||||||
// Each data bit is represented by a 32-bit RMT item that specifies how
|
// Each data bit is represented by a 32-bit RMT item that specifies how
|
||||||
// long to hold the signal high, followed by how long to hold it low.
|
// long to hold the signal high, followed by how long to hold it low.
|
||||||
void IRAM_ATTR ESP32RMTController::fillNext()
|
void ESP32RMTController::fillNext()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (mCur < mSize) {
|
if (mCur < mSize) {
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
* FastLED CPixelLEDController template, and ESP32RMTController,
|
* FastLED CPixelLEDController template, and ESP32RMTController,
|
||||||
* which just handles driving the RMT peripheral. One benefit of
|
* which just handles driving the RMT peripheral. One benefit of
|
||||||
* this design is that ESP32RMTContoller is not a template, so
|
* this design is that ESP32RMTContoller is not a template, so
|
||||||
* its methods can be marked with the IRAM_ATTR and end up in
|
* its methods can be marked with the and end up in
|
||||||
* IRAM memory. Another benefit is that all of the color channel
|
* IRAM memory. Another benefit is that all of the color channel
|
||||||
* processing is done up-front, in the templated class, so we
|
* processing is done up-front, in the templated class, so we
|
||||||
* can fill the RMT buffers more quickly.
|
* can fill the RMT buffers more quickly.
|
||||||
@ -240,7 +240,7 @@ public:
|
|||||||
ESP32RMTController(int DATA_PIN, int T1, int T2, int T3);
|
ESP32RMTController(int DATA_PIN, int T1, int T2, int T3);
|
||||||
|
|
||||||
// -- Get max cycles per fill
|
// -- Get max cycles per fill
|
||||||
uint32_t IRAM_ATTR getMaxCyclesPerFill() const { return mMaxCyclesPerFill; }
|
uint32_t getMaxCyclesPerFill() const { return mMaxCyclesPerFill; }
|
||||||
|
|
||||||
// -- Get or create the pixel data buffer
|
// -- Get or create the pixel data buffer
|
||||||
uint32_t * getPixelBuffer(int size_in_bytes);
|
uint32_t * getPixelBuffer(int size_in_bytes);
|
||||||
@ -251,21 +251,21 @@ public:
|
|||||||
|
|
||||||
// -- Show this string of pixels
|
// -- Show this string of pixels
|
||||||
// This is the main entry point for the pixel controller
|
// This is the main entry point for the pixel controller
|
||||||
void IRAM_ATTR showPixels();
|
void showPixels();
|
||||||
|
|
||||||
// -- Start up the next controller
|
// -- Start up the next controller
|
||||||
// This method is static so that it can dispatch to the
|
// This method is static so that it can dispatch to the
|
||||||
// appropriate startOnChannel method of the given controller.
|
// appropriate startOnChannel method of the given controller.
|
||||||
static void IRAM_ATTR startNext(int channel);
|
static void startNext(int channel);
|
||||||
|
|
||||||
// -- Start this controller on the given channel
|
// -- Start this controller on the given channel
|
||||||
// This function just initiates the RMT write; it does not wait
|
// This function just initiates the RMT write; it does not wait
|
||||||
// for it to finish.
|
// for it to finish.
|
||||||
void IRAM_ATTR startOnChannel(int channel);
|
void startOnChannel(int channel);
|
||||||
|
|
||||||
// -- Start RMT transmission
|
// -- Start RMT transmission
|
||||||
// Setting this RMT flag is what actually kicks off the peripheral
|
// Setting this RMT flag is what actually kicks off the peripheral
|
||||||
void IRAM_ATTR tx_start();
|
void tx_start();
|
||||||
|
|
||||||
// -- A controller is done
|
// -- A controller is done
|
||||||
// This function is called when a controller finishes writing
|
// This function is called when a controller finishes writing
|
||||||
@ -273,7 +273,7 @@ public:
|
|||||||
// handler (below), or as a callback from the built-in
|
// handler (below), or as a callback from the built-in
|
||||||
// interrupt handler. It is static because we don't know which
|
// interrupt handler. It is static because we don't know which
|
||||||
// controller is done until we look it up.
|
// controller is done until we look it up.
|
||||||
static void IRAM_ATTR doneOnChannel(int channel, void * arg);
|
static void doneOnChannel(int channel, void * arg);
|
||||||
|
|
||||||
// -- A controller is done
|
// -- A controller is done
|
||||||
// This function is called when a controller finishes writing
|
// This function is called when a controller finishes writing
|
||||||
@ -281,13 +281,13 @@ public:
|
|||||||
// handler (below), or as a callback from the built-in
|
// handler (below), or as a callback from the built-in
|
||||||
// interrupt handler. It is static because we don't know which
|
// interrupt handler. It is static because we don't know which
|
||||||
// controller is done until we look it up.
|
// controller is done until we look it up.
|
||||||
static void IRAM_ATTR doneOnRMTChannel(rmt_channel_t rmt_channel, void * arg);
|
static void doneOnRMTChannel(rmt_channel_t rmt_channel, void * arg);
|
||||||
|
|
||||||
// -- Custom interrupt handler
|
// -- Custom interrupt handler
|
||||||
// This interrupt handler handles two cases: a controller is
|
// This interrupt handler handles two cases: a controller is
|
||||||
// done writing its data, or a controller needs to fill the
|
// done writing its data, or a controller needs to fill the
|
||||||
// next half of the RMT buffer with data.
|
// next half of the RMT buffer with data.
|
||||||
static void IRAM_ATTR interruptHandler(void *arg);
|
static void interruptHandler(void *arg);
|
||||||
|
|
||||||
// -- Determine if there was a long pause
|
// -- Determine if there was a long pause
|
||||||
// Especially in ESP32, it seems hard to guarentee that interrupts fire
|
// Especially in ESP32, it seems hard to guarentee that interrupts fire
|
||||||
@ -297,13 +297,13 @@ public:
|
|||||||
// SIDE EFFECT: Triggers stop of the channel
|
// SIDE EFFECT: Triggers stop of the channel
|
||||||
//
|
//
|
||||||
// return FALSE means one needs to abort
|
// return FALSE means one needs to abort
|
||||||
bool IRAM_ATTR timingOk();
|
bool timingOk();
|
||||||
|
|
||||||
// -- Fill RMT buffer
|
// -- Fill RMT buffer
|
||||||
// Puts 32 bits of pixel data into the next 32 slots in the RMT memory
|
// Puts 32 bits of pixel data into the next 32 slots in the RMT memory
|
||||||
// Each data bit is represented by a 32-bit RMT item that specifies how
|
// Each data bit is represented by a 32-bit RMT item that specifies how
|
||||||
// long to hold the signal high, followed by how long to hold it low.
|
// long to hold the signal high, followed by how long to hold it low.
|
||||||
void IRAM_ATTR fillNext();
|
void fillNext();
|
||||||
|
|
||||||
// -- Init pulse buffer
|
// -- Init pulse buffer
|
||||||
// Set up the buffer that will hold all of the pulse items for this
|
// Set up the buffer that will hold all of the pulse items for this
|
||||||
|
Reference in New Issue
Block a user