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

Detect if running on Arduino or ESP #10

Closed
koffienl opened this issue Feb 10, 2016 · 0 comments
Closed

Detect if running on Arduino or ESP #10

koffienl opened this issue Feb 10, 2016 · 0 comments

Comments

@koffienl
Copy link

In arduino_functions.h there is the following code:

#if (defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)) && !defined(MAX_RECORDINGS)
  #define MAX_RECORDINGS 400   //In combination with Homeduino maximum 490*2Byte are possible. Higher values block the arduino
#endif
#if (defined(__AVR_ATmega32U4__) || defined(TEENSY20) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)) && !defined(MAX_RECORDINGS)
  #define MAX_RECORDINGS 512   //on the bigger arduino we have enough SRAM
#endif
#if !defined(MAX_RECORDINGS)
  #define MAX_RECORDINGS 255   // fallback for undefined Processor.
#endif

To get this ocde working on ESP I have changed the the line #define MAX_RECORDINGS 255 into #define MAX_RECORDINGS 400
Would be nice if we could make an ESP detection. I was thinking to put ESP.getChipId() in there, but that would'nt compile at all when the board is an Arduino.

Any thoughts about this? Just set the MAX_RECORDINGS higher for undefined or try to recognize an ESP so this could is easily switched between Arduino and ESP ?

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

1 participant