Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino library: memset not defined #3

Closed
jbmorley opened this issue Apr 2, 2018 · 4 comments
Closed

Arduino library: memset not defined #3

jbmorley opened this issue Apr 2, 2018 · 4 comments

Comments

@jbmorley
Copy link

jbmorley commented Apr 2, 2018

I found that the library (used with the examples) wouldn't compile for me when targeting my Adafruit Huzzah32 ESP32-based board.

The specific issue appears to be that it can't find memset. I'm still not very familiar with Arduino and its idiosyncrasies, but some Googlging reveals that this can be fixed by importing Arduino.h.

I've added the following to the top of exixe.cpp and everything works fine:

#include "Arduino.h"

This could be an issue with my setup but it is, as far as I can tell, the default configuration for the ESP32 boards and I'm not aware I've done anything strange.

@dekuNukem
Copy link
Owner

Thanks for the discovery, I don't have a ESP32 myself and apparently it's different.

Isn't memset in string.h? Try#include <string.h> instead of Arduino.h and see if it works. I'll test and update the library tomorrow.

@jbmorley
Copy link
Author

jbmorley commented Apr 3, 2018

A collection of other symbols seem to be missing with just #include <string.h>.

/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp: In constructor 'exixe::exixe(int)':
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:18:19: error: 'OUTPUT' was not declared in this scope
   pinMode(cs_pin, OUTPUT);
                   ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:18:25: error: 'pinMode' was not declared in this scope
   pinMode(cs_pin, OUTPUT);
                         ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:19:24: error: 'HIGH' was not declared in this scope
   digitalWrite(cs_pin, HIGH);
                        ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:19:28: error: 'digitalWrite' was not declared in this scope
   digitalWrite(cs_pin, HIGH);
                            ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp: In member function 'void exixe::spi_write()':
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:25:24: error: 'LOW' was not declared in this scope
   digitalWrite(cs_pin, LOW);
                        ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:25:27: error: 'digitalWrite' was not declared in this scope
   digitalWrite(cs_pin, LOW);
                           ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:26:11: error: 'delay' was not declared in this scope
   delay(10);
           ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:29:24: error: 'HIGH' was not declared in this scope
   digitalWrite(cs_pin, HIGH);
                        ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp: In member function 'void exixe::crossfade_init(unsigned char, unsigned int, unsigned char, unsigned char)':
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:107:34: error: 'millis' was not declared in this scope
   animation_start_frame = millis() / EXIXE_ANIMATION_FRAME_DURATION_MS;
                                  ^
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp: In member function 'unsigned char exixe::crossfade_run()':
/Users/jbmorley/Documents/Arduino/libraries/exixe/exixe.cpp:116:41: error: 'millis' was not declared in this scope
   unsigned long current_frame = (millis() / EXIXE_ANIMATION_FRAME_DURATION_MS) - animation_start_frame;
                                         ^

@dekuNukem
Copy link
Owner

I updated the library just now so try it out.

Feel free to submit pull requests too if there are any other issues.

@jbmorley
Copy link
Author

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants