#include <Adafruit_NeoPixel.h>
#include <inttypes.h>
+#include <stdlib.h>
+#include <math.h>
#define ROWS 8
#define COLS 32
we must do so directly without allocating a working buffer.
Uncomment this to indicate that display_rgb_direct() must be used.
*/
-#define NEOPIXEL_ATE_MY_RAM
+//#define NEOPIXEL_ATE_MY_RAM
-#ifdef NEOPIXEL_ATE_MY_RAM
+//#ifdef NEOPIXEL_ATE_MY_RAM
#define LED_PIN 12
-#else
-#define LED_PIN PA2
-#endif
+//#else
+//#define LED_PIN 12
+//#endif
int render_image(uint8_t buff[ROWS][COLS][3], const uint8_t image[]);
int display_rgb(uint8_t buff[ROWS][COLS][3]);
-int display_rgb_direct(const uint8_t image[]);
+//int display_rgb_direct(const uint8_t image[]);
static const uint8_t big_image_data[BIG_IMAGE_FILE_SIZE] =
{
void setup()
{
- pinMode(LED_PIN, OUTPUT);
+ //pinMode(LED_PIN, OUTPUT);
led_matrix.begin();
+ //Serial.begin(9600);
}
void loop()
{
- #ifndef NEOPIXEL_ATE_MY_RAM
- uint8_t frame_buffer[ROWS][COLS][3] = {{{0}}};
-
- render_image(frame_buffer, big_image_data);
- display_rgb(frame_buffer);
- #else
- display_rgb_direct(big_image_data);
- #endif
+ volatile uint8_t takovata = 0;
+ //#ifndef NEOPIXEL_ATE_MY_RAM
+ //uint8_t frame_buffer[ROWS][COLS][3];
+
+ //Serial.println("TETS");
+ //render_image(frame_buffer, big_image_data);
+ //display_rgb(frame_buffer);
+ display_rgb((uint8_t (*)[32][3]) &takovata);
+ //#else
+ //display_rgb_direct(big_image_data);
+ //#endif
}
int render_image(uint8_t buff[ROWS][COLS][3], const uint8_t image[])
{
- size_t row_offset, col_offset;
+ //size_t row_offset, col_offset;
if (buff == NULL || image == NULL)
return -1;
for (uint8_t row = 0; row < ROWS; row++)
{
- row_offset = row * COLS * 3;
+ //row_offset = row * COLS * 3;
for (uint8_t col = 0; col < COLS; col++)
{
- col_offset = col * 3;
+ //col_offset = col * 3;
for (uint8_t i = 0; i < 3; i++)
{
- buff[row][col][i] = image[PPM_HEADER_LENGHT + row_offset + col_offset + i];
+ buff[row][col][i] = image[PPM_HEADER_LENGHT + row * COLS * 3 + col * 3 + i];
}
}
}
return 0;
}
-
+/*
int display_rgb_direct(const uint8_t image[])
{
size_t row_offset, col_offset;
return 0;
}
+*/
\ No newline at end of file