WIP: Strange exceptions in Corner:➿ Crashing when accessing _short_neighbours after a corner is finished animating.
This commit is contained in:
@ -1,3 +1,25 @@
|
||||
#pragma once
|
||||
#include <FastLED.h>
|
||||
#include <list>
|
||||
#include "edge.h"
|
||||
|
||||
class Corner {};
|
||||
class Corner {
|
||||
public:
|
||||
Edge* e1;
|
||||
Edge* e2;
|
||||
Corner(Edge* e1, Edge* e2);
|
||||
std::list<uint16_t> _leds;
|
||||
std::list<Corner*> _long_neighbours {};
|
||||
std::list<Corner*> _short_neighbours {nullptr};
|
||||
CRGB color = CRGB(0x000000);
|
||||
CRGB source_color;
|
||||
CRGB target_color;
|
||||
bool effect_running = false;
|
||||
uint8_t color_blend_state = 255;
|
||||
uint16_t effect_id;
|
||||
void loop();
|
||||
void draw();
|
||||
void blend_to(CRGB color, uint16_t effect_id=0);
|
||||
void add_led(uint16_t led_id);
|
||||
void merge_leds(Corner* c);
|
||||
};
|
@ -1,3 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
class Edge {};
|
||||
class Edge {
|
||||
public:
|
||||
Edge* neighbour = nullptr;
|
||||
};
|
@ -5,10 +5,12 @@
|
||||
#include "corner.h"
|
||||
|
||||
class Node {
|
||||
private:
|
||||
uint16_t _number;
|
||||
public:
|
||||
Node* neighbours[CORNERS_PER_PART];
|
||||
Edge* edges[CORNERS_PER_PART];
|
||||
Corner* corners[CORNERS_PER_PART];
|
||||
Node();
|
||||
Node(uint16_t number);
|
||||
Node* create_neighbour(uint8_t edge);
|
||||
};
|
Reference in New Issue
Block a user