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

When trying to compile your fireplace.yaml effect, I am getting compilation errors. #3

Open
derekyle opened this issue Dec 16, 2022 · 3 comments

Comments

@derekyle
Copy link

error: 'random8' was not declared in this scope; did you mean 'random'?

error: 'scale8_video' was not declared in this scope

error: 'qadd8' was not declared in this scope

Are the 3 errors I get. Are there some missing dependencies that I should be including?

@derekyle
Copy link
Author

Actually, I figured it out. It looks like those functions are only available on the FastLed platform, which is deprecated. But I was able to get it to work by downgrading the arduino platform version and setting to FastLed.

@soundstorm
Copy link
Owner

I just merged the PR by @dvv, maybe he can adjust that to work with builtin functions.

@dvv
Copy link
Contributor

dvv commented Dec 18, 2022

Please try with below header.

#pragma once

#ifndef FASTLED_INTERNAL
uint8_t qadd8( uint8_t i, uint8_t j)
{
  unsigned int t = i + j;
  if( t > 255) t = 255;
  return t;
}

uint8_t scale8_video( uint8_t i, uint8_t scale)
{
  uint8_t j = (((int)i * (int)scale) >> 8) + ((i&&scale)?1:0);
  // uint8_t nonzeroscale = (scale != 0) ? 1 : 0;
  // uint8_t j = (i == 0) ? 0 : (((int)i * (int)(scale) ) >> 8) + nonzeroscale;
  return j;
}
#endif

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

3 participants