Skip to content
Snippets Groups Projects
Commit 1db1ac0b authored by dx's avatar dx
Browse files

display: cleanup, reformat, remove unused stuff

parent 34775f6f
Branches
Tags
No related merge requests found
...@@ -10,44 +10,12 @@ ...@@ -10,44 +10,12 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "badge23/scope.h"
#include "esp_system.h" #include "esp_system.h"
#include "../../usermodule/uctx/uctx/ctx.h" #include "../../usermodule/uctx/uctx/ctx.h"
volatile Ctx *the_ctx = NULL; volatile Ctx *the_ctx = NULL;
uint16_t *pixels;
typedef struct leds_cfg {
bool active_paddles[10];
} display_cfg_t;
static QueueHandle_t display_queue = NULL;
static void display_task(TimerHandle_t aaaaa);
//static void display_task(void* arg);
static void _display_init() {
GC9A01_Init();
// GC9A01_Screen_Load(0,0,240,240,pixels);
GC9A01_Update();
/*
display_queue = xQueueCreate(1, sizeof(display_cfg_t));
TaskHandle_t handle;
xTaskCreate(&display_task, "Display", 4096, NULL, configMAX_PRIORITIES - 3, &handle);
*/
/* SCOPE TASK
TimerHandle_t aa = xTimerCreate("Display", pdMS_TO_TICKS(100), pdTRUE, (void *) 0, *display_task);
if( xTimerStart(aa, 0 ) != pdPASS )
{
}
*/
}
void display_ctx_init() { void display_ctx_init() {
the_ctx = ctx_new_for_framebuffer( the_ctx = ctx_new_for_framebuffer(
...@@ -78,35 +46,9 @@ void display_fill(uint16_t col){ ...@@ -78,35 +46,9 @@ void display_fill(uint16_t col){
GC9A01_FillRect(0, 0, 240, 240, col); GC9A01_FillRect(0, 0, 240, 240, col);
} }
void display_draw_scope(){
//display_cfg_t display_;
uint16_t line[240];
/*
printf("waiting...\n");
xQueueReceive(display_queue, &display_, portMAX_DELAY);
printf("go...\n");
*/
//uint32_t t0 = esp_log_timestamp();
begin_scope_read();
for(int y=0; y<240; y++){
read_line_from_scope(&(line[0]), y);
memcpy(&ScreenBuff[y * 240], line, sizeof(line));
}
end_scope_read();
//uint32_t td = esp_log_timestamp() - t0;
// printf("it took %lu\n", td);
display_update();
}
//static void display_task(void* arg) {
static void display_task(TimerHandle_t aaaaa) {
display_draw_scope();
}
void display_init() { void display_init() {
_display_init(); GC9A01_Init();
GC9A01_Update();
display_ctx_init(); display_ctx_init();
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
void display_init(); void display_init();
void display_ctx_init(); void display_ctx_init();
void display_draw_scope();
void display_update(); void display_update();
void display_draw_pixel(uint8_t x, uint8_t y, uint16_t col); void display_draw_pixel(uint8_t x, uint8_t y, uint16_t col);
uint16_t display_get_pixel(uint8_t x, uint8_t y); uint16_t display_get_pixel(uint8_t x, uint8_t y);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment