Skip to content

Commit

Permalink
clear screen when load game
Browse files Browse the repository at this point in the history
  • Loading branch information
solosky committed Nov 20, 2024
1 parent 863ae96 commit e43b955
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions fw/application/src/app/game/port/common/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
#include "nrf_log.h"
#include "nrf_log_ctrl.h"

void JOY_OLED_clear() {
JOY_OLED_data_start(0);
for (uint16_t i = 0; i < 1024; i++) {
JOY_OLED_send(0);
}
JOY_OLED_end();
}

void JOY_OLED_end() { hal_spi_bus_release(mui_u8g2_get_spi_device()); }

void JOY_OLED_write_data(uint8_t is_data, uint8_t data) {
Expand Down Expand Up @@ -37,6 +45,7 @@ void JOY_OLED_data_start(uint8_t y) {
hal_spi_bus_aquire(mui_u8g2_get_spi_device());
JOY_OLED_set_pos(0, y);
}
void JOY_init() { JOY_OLED_clear(); }

void JOY_idle() {
app_sched_execute();
Expand Down
3 changes: 2 additions & 1 deletion fw/application/src/app/game/port/common/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern "C" {

// Game slow-down delay
#define JOY_SLOWDOWN() DLY_ms(10)
#define JOY_init() //
//#define JOY_init() //

// // Init driver
// static inline void JOY_init(void) {
Expand Down Expand Up @@ -87,6 +87,7 @@ void JOY_OLED_end() ;

void JOY_sound(uint8_t freq, uint8_t dur);
uint16_t JOY_random(void);
void JOY_init(void);
void JOY_idle();
uint8_t JOY_exit();
long map(long x, long in_min, long in_max, long out_min, long out_max) ;
Expand Down

0 comments on commit e43b955

Please sign in to comment.