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

Makefile Compilation Fix #490

Merged
merged 8 commits into from Nov 2, 2017

Conversation

Projects
None yet
3 participants
@NicoHood
Contributor

NicoHood commented Sep 1, 2017

Also see #485

I've made very clean commits and everyone should be simple and understandable on its own. The inclusion of the additional headers is safe, as they are included by Arduino.h.

All changes were tested with an Arduino environment. The changed LED code for the power management also!

Benefits

  • Less Arduino overhead (240 bytes for blink) with makefiles
  • Better control with makefile environments
  • Still Arduino compatible as before

NicoHood added some commits Aug 23, 2017

Include stdlib.h if abs() is not available
This is required as Arduino.h #define's its own abs() makro. Outside of Arduino environments stdlib is required.
Also see: arduino/Arduino#6684
Include string.h for memset function
This include is normally done by Arduino.h but still required for makefile environments
$ grep string.h . -r
./Arduino.h:#include <string.h>
Include math.h for pow()
math.h is normally included by Arduino.h but required for a makefile build
$ grep math.h . -r
./Arduino.h:#include <math.h>
@@ -125,7 +125,7 @@ uint8_t calculate_max_brightness_for_power_mW( uint8_t target_brightness, uint32
if( requested_power_mW < max_power_mW) {
#if POWER_LED > 0
if( gMaxPowerIndicatorLEDPinNumber ) {
digitalWrite(gMaxPowerIndicatorLEDPinNumber, LOW); // turn the LED off
Pin(gMaxPowerIndicatorLEDPinNumber).lo(); // turn the LED off

This comment has been minimized.

@ladislas

ladislas Sep 1, 2017

where does that come from? is it part of the avr stdlib?

@ladislas

ladislas Sep 1, 2017

where does that come from? is it part of the avr stdlib?

This comment has been minimized.

@NicoHood

NicoHood Sep 2, 2017

Contributor

@ladislas That is a FastLed class inside fastpin.h. Also checkout FastPin, which is even better, but not suitable in this flexible case.

@NicoHood

NicoHood Sep 2, 2017

Contributor

@ladislas That is a FastLed class inside fastpin.h. Also checkout FastPin, which is even better, but not suitable in this flexible case.

@ladislas

This comment has been minimized.

Show comment
Hide comment
@ladislas

ladislas Sep 1, 2017

it looks great and promising!

ladislas commented Sep 1, 2017

it looks great and promising!

@focalintent focalintent merged commit 64d729e into FastLED:master Nov 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment