summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-09-02 15:32:30 -0700
committerGitHub <noreply@github.com>2020-09-02 15:32:30 -0700
commit786f4ed11477cb62d830ef6f29c349e3bd1d3b39 (patch)
tree7dc67a08fad0611565cff15c013c7e57a16d0039 /shared-bindings
parentf27b89632de427ffa268d3a9dee4e6e9b5da407b (diff)
parent17a5a85528525352ec1821127fafec2acb239196 (diff)
Merge pull request #3344 from jepler/issue-3184
Fix RGBMatrix, FrameBufferDisplay bugs
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/rgbmatrix/RGBMatrix.c2
-rw-r--r--shared-bindings/rgbmatrix/RGBMatrix.h21
2 files changed, 2 insertions, 21 deletions
diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c
index 9cfc0d409..e4683af92 100644
--- a/shared-bindings/rgbmatrix/RGBMatrix.c
+++ b/shared-bindings/rgbmatrix/RGBMatrix.c
@@ -252,7 +252,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_deinit(mp_obj_t self_in) {
STATIC MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_deinit_obj, rgbmatrix_rgbmatrix_deinit);
static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) {
- if (!self->core.rgbPins) {
+ if (!self->protomatter.rgbPins) {
raise_deinited_error();
}
}
diff --git a/shared-bindings/rgbmatrix/RGBMatrix.h b/shared-bindings/rgbmatrix/RGBMatrix.h
index 027f817bb..1dc5a406c 100644
--- a/shared-bindings/rgbmatrix/RGBMatrix.h
+++ b/shared-bindings/rgbmatrix/RGBMatrix.h
@@ -24,29 +24,12 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_RGBMATRIX_RGBMATRIX_H
-#define MICROPY_INCLUDED_SHARED_BINDINGS_RGBMATRIX_RGBMATRIX_H
+#pragma once
#include "shared-module/rgbmatrix/RGBMatrix.h"
#include "lib/protomatter/core.h"
extern const mp_obj_type_t rgbmatrix_RGBMatrix_type;
-typedef struct {
- mp_obj_base_t base;
- mp_obj_t framebuffer;
- mp_buffer_info_t bufinfo;
- Protomatter_core core;
- void *timer;
- uint16_t bufsize, width;
- uint8_t rgb_pins[30];
- uint8_t addr_pins[10];
- uint8_t clock_pin, latch_pin, oe_pin;
- uint8_t rgb_count, addr_count;
- uint8_t bit_depth;
- bool core_is_initialized;
- bool paused;
- bool doublebuffer;
-} rgbmatrix_rgbmatrix_obj_t;
void common_hal_rgbmatrix_rgbmatrix_construct(rgbmatrix_rgbmatrix_obj_t* self, int width, int bit_depth, uint8_t rgb_count, uint8_t* rgb_pins, uint8_t addr_count, uint8_t* addr_pins, uint8_t clock_pin, uint8_t latch_pin, uint8_t oe_pin, bool doublebuffer, mp_obj_t framebuffer, void* timer);
void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t*);
@@ -57,5 +40,3 @@ bool common_hal_rgbmatrix_rgbmatrix_get_paused(rgbmatrix_rgbmatrix_obj_t* self);
void common_hal_rgbmatrix_rgbmatrix_refresh(rgbmatrix_rgbmatrix_obj_t* self);
int common_hal_rgbmatrix_rgbmatrix_get_width(rgbmatrix_rgbmatrix_obj_t* self);
int common_hal_rgbmatrix_rgbmatrix_get_height(rgbmatrix_rgbmatrix_obj_t* self);
-
-#endif