more tests
This commit is contained in:
@ -3,8 +3,6 @@
|
||||
#include "PontCoopScheduler.h"
|
||||
|
||||
|
||||
static canvas_t *canvas;
|
||||
|
||||
#define MAX_COLOR 0x0d
|
||||
|
||||
typedef enum {
|
||||
@ -31,7 +29,7 @@ void displayTestExec(void *args) {
|
||||
switch (state) {
|
||||
// wipe last column
|
||||
case e_WIPE_LAST_COLUMN_DOWN:
|
||||
for (uint16_t i = 0; i < canvas->height; i++) {
|
||||
for (uint16_t i = 0; i < canvas.height; i++) {
|
||||
canvasSetPixel(last, i, 0);
|
||||
}
|
||||
last = 0xff;
|
||||
@ -39,31 +37,31 @@ void displayTestExec(void *args) {
|
||||
// pixels up
|
||||
case e_PIXELS_UP:
|
||||
if (last != 0xff) {
|
||||
*((canvas->canvas)+last) = 0x80;
|
||||
*((canvas.canvas)+last) = 0x80;
|
||||
}
|
||||
|
||||
last = current;
|
||||
*((canvas->canvas)+current) = (color + 0x80);
|
||||
*((canvas.canvas)+current) = (color + 0x80);
|
||||
current++;
|
||||
if (current >= canvas->size) {
|
||||
if (current >= canvas.size) {
|
||||
current = 0;
|
||||
state = e_WIPE_LAST_PIXEL_UP;
|
||||
}
|
||||
break;
|
||||
// wipe last pixel
|
||||
case e_WIPE_LAST_PIXEL_UP:
|
||||
*((canvas->canvas)+last) = 0x80;
|
||||
*((canvas.canvas)+last) = 0x80;
|
||||
last = 0xff;
|
||||
current = canvas->size - 1;
|
||||
current = canvas.size - 1;
|
||||
state = e_PIXELS_DOWN;
|
||||
// pixels down
|
||||
case e_PIXELS_DOWN:
|
||||
if (last != 0xff) {
|
||||
*((canvas->canvas)+last) = 0x80;
|
||||
*((canvas.canvas)+last) = 0x80;
|
||||
}
|
||||
|
||||
last = current;
|
||||
*((canvas->canvas)+current) = (color + 0x80);
|
||||
*((canvas.canvas)+current) = (color + 0x80);
|
||||
current--;
|
||||
if (current < 0) {
|
||||
current = 0;
|
||||
@ -72,45 +70,45 @@ void displayTestExec(void *args) {
|
||||
break;
|
||||
// wipe last pixel
|
||||
case e_WIPE_LAST_PIXEL_DOWN:
|
||||
*((canvas->canvas)+last) = 0x80;
|
||||
*((canvas.canvas)+last) = 0x80;
|
||||
last = 0xff;
|
||||
state = e_ROWS_UP;
|
||||
// rows up
|
||||
case e_ROWS_UP:
|
||||
if (last != 0xff) {
|
||||
for (uint16_t i = 0; i < canvas->width; i++) {
|
||||
for (uint16_t i = 0; i < canvas.width; i++) {
|
||||
canvasSetPixel(i, last, 0);
|
||||
}
|
||||
}
|
||||
|
||||
last = current;
|
||||
for (uint16_t i = 0; i < canvas->width; i++) {
|
||||
for (uint16_t i = 0; i < canvas.width; i++) {
|
||||
canvasSetPixel(i, current, color);
|
||||
}
|
||||
current++;
|
||||
if (current >= canvas->height) {
|
||||
if (current >= canvas.height) {
|
||||
current = 0;
|
||||
state = e_WIPE_LAST_ROW_UP;
|
||||
}
|
||||
break;
|
||||
// wipe last row
|
||||
case e_WIPE_LAST_ROW_UP:
|
||||
for (uint16_t i = 0; i < canvas->width; i++) {
|
||||
for (uint16_t i = 0; i < canvas.width; i++) {
|
||||
canvasSetPixel(i, last, 0);
|
||||
}
|
||||
last = 0xff;
|
||||
current = canvas->height - 1;
|
||||
current = canvas.height - 1;
|
||||
state = e_ROWS_DOWN;
|
||||
// rows down
|
||||
case e_ROWS_DOWN:
|
||||
if (last != 0xff) {
|
||||
for (uint16_t i = 0; i < canvas->width; i++) {
|
||||
for (uint16_t i = 0; i < canvas.width; i++) {
|
||||
canvasSetPixel(i, last, 0);
|
||||
}
|
||||
}
|
||||
|
||||
last = current;
|
||||
for (uint16_t i = 0; i < canvas->width; i++) {
|
||||
for (uint16_t i = 0; i < canvas.width; i++) {
|
||||
canvasSetPixel(i, current, color);
|
||||
}
|
||||
current--;
|
||||
@ -121,7 +119,7 @@ void displayTestExec(void *args) {
|
||||
break;
|
||||
// wipe last row
|
||||
case e_WIPE_LAST_ROW_DOWN:
|
||||
for (uint16_t i = 0; i < canvas->width; i++) {
|
||||
for (uint16_t i = 0; i < canvas.width; i++) {
|
||||
canvasSetPixel(i, last, 0);
|
||||
}
|
||||
last = 0xff;
|
||||
@ -129,39 +127,39 @@ void displayTestExec(void *args) {
|
||||
// columns up
|
||||
case e_COLUMNS_UP:
|
||||
if (last != 0xff) {
|
||||
for (uint16_t i = 0; i < canvas->height; i++) {
|
||||
for (uint16_t i = 0; i < canvas.height; i++) {
|
||||
canvasSetPixel(last, i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
last = current;
|
||||
for (uint16_t i = 0; i < canvas->height; i++) {
|
||||
for (uint16_t i = 0; i < canvas.height; i++) {
|
||||
canvasSetPixel(current, i, color);
|
||||
}
|
||||
current++;
|
||||
if (current >= canvas->width) {
|
||||
if (current >= canvas.width) {
|
||||
current = 0;
|
||||
state = e_WIPE_LAST_COLUMN_UP;
|
||||
}
|
||||
break;
|
||||
// wipe last column
|
||||
case e_WIPE_LAST_COLUMN_UP:
|
||||
for (uint16_t i = 0; i < canvas->height; i++) {
|
||||
for (uint16_t i = 0; i < canvas.height; i++) {
|
||||
canvasSetPixel(last, i, 0);
|
||||
}
|
||||
last = 0xff;
|
||||
current = canvas->width - 1;
|
||||
current = canvas.width - 1;
|
||||
state = e_COLUMNS_DOWN;
|
||||
// columns down
|
||||
case e_COLUMNS_DOWN:
|
||||
if (last != 0xff) {
|
||||
for (uint16_t i = 0; i < canvas->height; i++) {
|
||||
for (uint16_t i = 0; i < canvas.height; i++) {
|
||||
canvasSetPixel(last, i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
last = current;
|
||||
for (uint16_t i = 0; i < canvas->height; i++) {
|
||||
for (uint16_t i = 0; i < canvas.height; i++) {
|
||||
canvasSetPixel(current, i, color);
|
||||
}
|
||||
current--;
|
||||
@ -181,7 +179,6 @@ void displayTestExec(void *args) {
|
||||
}
|
||||
|
||||
void displayTestInit() {
|
||||
canvas = canvasGet();
|
||||
schAdd(displayTestExec, NULL, 0, 50);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user