From 34ffc960e8ad869e396ebf23cf8f20f48806bf85 Mon Sep 17 00:00:00 2001 From: shr34sachin Date: Tue, 18 Jun 2019 16:59:08 +0545 Subject: [PATCH] Update DMDFrame.cpp Changed the datatype of pixelswide and pixelsHigh from byte to uint16_t and also type-casted the row_width_bytes and height_in_panels, so that the library could work for more than 7 display boards in single row. The similar update is made in DMD2.h file too. --- DMDFrame.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DMDFrame.cpp b/DMDFrame.cpp index 1cd339c..eb95b07 100644 --- a/DMDFrame.cpp +++ b/DMDFrame.cpp @@ -21,14 +21,14 @@ If not, see . */ -DMDFrame::DMDFrame(byte pixelsWide, byte pixelsHigh) +DMDFrame::DMDFrame(uint16_t pixelsWide, uint16_t pixelsHigh) : width(pixelsWide), height(pixelsHigh), font(0) { - row_width_bytes = (pixelsWide + 7)/8; // on full panels pixelsWide is a multiple of 8, but for sub-regions may not be - height_in_panels = (pixelsHigh + PANEL_HEIGHT-1) / PANEL_HEIGHT; + row_width_bytes = (byte)((pixelsWide + 7)/8); // on full panels pixelsWide is a multiple of 8, but for sub-regions may not be + height_in_panels = (byte)((pixelsHigh + PANEL_HEIGHT-1) / PANEL_HEIGHT); bitmap = (uint8_t *)malloc(bitmap_bytes()); memset((void *)bitmap, 0xFF, bitmap_bytes()); }