Skip to content

Commit

Permalink
increase usb read size, set waveform rect dynamically, remove duplica…
Browse files Browse the repository at this point in the history
…te font destroy
  • Loading branch information
laamaa committed Apr 13, 2024
1 parent fd68d8c commit b3d50b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ int main(int argc, char *argv[]) {
close_renderer();
close_serial_port();
SDL_free(serial_buf);
kill_inline_font();
SDL_Quit();
return 0;
}
5 changes: 2 additions & 3 deletions src/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ void draw_waveform(struct draw_oscilloscope_waveform_command *command) {
wf_rect.x = texture_width - command->waveform_size;
wf_rect.y = 0;
wf_rect.w = command->waveform_size;
wf_rect.h = 21;
wf_rect.h = waveform_max_height+1;
} else {
wf_rect.x = texture_width - prev_waveform_size;
wf_rect.y = 0;
wf_rect.w = prev_waveform_size;
wf_rect.h = 21;
wf_rect.h = waveform_max_height+1;
}
prev_waveform_size = command->waveform_size;

Expand Down Expand Up @@ -325,7 +325,6 @@ void display_keyjazz_overlay(uint8_t show, uint8_t base_octave,
void render_screen() {
if (dirty) {
dirty = 0;
// ticks = SDL_GetTicks();
SDL_SetRenderTarget(rend, NULL);

SDL_SetRenderDrawColor(rend, background_color.r, background_color.g,
Expand Down
4 changes: 2 additions & 2 deletions src/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#include <stdint.h>
#ifdef USE_LIBUSB
// Max packet length of the USB endpoint
#define serial_read_size 512
#define serial_read_size 1024
int init_serial_with_file_descriptor(int file_descriptor);
#else
// maximum amount of bytes to read from the serial in one read()
#define serial_read_size 512
#define serial_read_size 1024
#endif

int init_serial(int verbose, char *preferred_device);
Expand Down

0 comments on commit b3d50b1

Please sign in to comment.