Skip to content
Snippets Groups Projects
Commit 12f478a8 authored by dx's avatar dx Committed by q3k
Browse files

display: cleanup, reformat, remove unused stuff

parent 2ea31d35
No related branches found
No related tags found
No related merge requests found
......@@ -10,56 +10,24 @@
#include <string.h>
#include <math.h>
#include "badge23/scope.h"
#include "esp_system.h"
#include "../../usermodule/uctx/uctx/ctx.h"
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() {
the_ctx = ctx_new_for_framebuffer(
the_ctx = ctx_new_for_framebuffer(
ScreenBuff,
GC9A01_Width,
GC9A01_Height,
GC9A01_Width * 2,
CTX_FORMAT_RGB565_BYTESWAPPED
);
// rotate by 180 deg and translate x and y by 120 px to have (0,0) at the center of the screen
ctx_apply_transform(the_ctx,-1,0,120,0,-1,120,0,0,1);
// rotate by 180 deg and translate x and y by 120 px to have (0,0) at the center of the screen
ctx_apply_transform(the_ctx,-1,0,120,0,-1,120,0,0,1);
}
void display_update(){
......@@ -78,35 +46,9 @@ void display_fill(uint16_t 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() {
_display_init();
display_ctx_init();
void display_init() {
GC9A01_Init();
GC9A01_Update();
display_ctx_init();
}
......@@ -6,7 +6,6 @@
void display_init();
void display_ctx_init();
void display_draw_scope();
void display_update();
void display_draw_pixel(uint8_t x, uint8_t y, uint16_t col);
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.
Finish editing this message first!
Please register or to comment