Hi,
I ran into a problem while writing a LightController
I got the error: "'Profile' does not name a type; did you mean 'tmpfile'?
"
at: static Profile runningProfiles[MAX_RUNNING_PROFILES]; (Class1)
Im guessing i can't compile Class 1 before compiling Class2 and the other way around.
Any way to fix this or am i doing sth wrong?
Thanks in advance, Tello.
Class1:
#ifndef ProfileBuffer_h;
#define ProfileBuffer_h;
#include <FastLED.h>
#include "Arduino.h"
#include "Profiles.h"
class ProfileBuffer{
public :
static const int MAX_RUNNING_PROFILES = 5;
static Profile runningProfiles[MAX_RUNNING_PROFILES];
static inline int currentlyRunningProfiles = 0;
ProfileBuffer(){}
static void checkProfiles(){
for(int i = 0; i < currentlyRunningProfiles; i++){
while(runningProfiles[i].finished && runningProfiles[i].id >= 0){
removeProfile(i);
}
}
}
static void removeProfile(int i){
for(int x = i; x < MAX_RUNNING_PROFILES-1; x++){
runningProfiles[x] = runningProfiles[x+1];
}
runningProfiles[MAX_RUNNING_PROFILES-1].finished = true;
runningProfiles[MAX_RUNNING_PROFILES-1].id = -1;
currentlyRunningProfiles--;
}
};
#endif
Class2:
#ifndef Profiles_h;
#define Profiles_h;
#include <FastLED.h>
#include "Arduino.h";
#include "ProfileBuffer.h"
class Profile{
public :
static const int profileCount = 4;
static const int NUM_STRIPS = 4;
static const int NUM_LEDS_PER_STRIP = 72;
static const int NUM_LEDS = NUM_STRIPS * NUM_LEDS_PER_STRIP;
int currentTick;
int id = -1;
CRGB color;
bool finished = false;
bool cancelOnNew = false;
Profile(){
finished = true;
id = -1;
}
Profile(int id_, CRGB color_){
id = id_;
color = color_;
finished = false;
}
void finish(){
finished = true;
ProfileBuffer::checkProfiles();
}
};
#endif