Skip to content
Snippets Groups Projects
Commit cf1e47fc authored by moon2's avatar moon2 :speech_balloon:
Browse files

display: rotated scope 90deg for the usual orientation

parent 177f5c2a
No related branches found
No related tags found
No related merge requests found
Pipeline #5517 passed
......@@ -67,13 +67,8 @@ void display_fill(uint16_t col){
}
void display_draw_scope(){
uint16_t line[240];
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();
if(!scope_active) return;
scope_write_to_framebuffer(&ScreenBuff);
GC9A01_Update();
}
......
......@@ -10,6 +10,4 @@ typedef struct {
void init_scope(uint16_t size);
void write_to_scope(int16_t value);
void begin_scope_read();
void end_scope_read();
void read_line_from_scope(uint16_t * line, int16_t point);
void scope_write_to_framebuffer(uint16_t * framebuffer);
......@@ -30,8 +30,17 @@ void begin_scope_read(){
scope->is_being_read = 1; //best mutex
}
void read_line_from_scope(uint16_t * line, int16_t point){
memset(line, 0, 480);
void end_scope_read(){
if(scope == NULL) return;
scope->is_being_read = 0; //best mutex
}
void scope_write_to_framebuffer(uint16_t * framebuffer){
//assumes 240x240 16bit framebuffer for now
begin_scope_read();
memset(framebuffer, 0, 240*240*sizeof(uint16_t));
for(int point = 0; point < 240; point++){
int16_t startpoint = scope->write_head_position - point;
while(startpoint < 0){
startpoint += scope->buffer_size;
......@@ -53,11 +62,8 @@ void read_line_from_scope(uint16_t * line, int16_t point){
stop = inter;
}
for(int16_t i = start; i <= stop; i++){
line[i] = 255;
framebuffer[point + i*240] = 255;
}
}
void end_scope_read(){
if(scope == NULL) return;
scope->is_being_read = 0; //best mutex
end_scope_read();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment