|
|
@ -31,35 +31,8 @@ PageState_t* dsp_mgr_get_state(void) { return NULL; } |
|
|
|
int compute_x_pos_by_center(int16_t x, int16_t width) { return x - width / 2; } |
|
|
|
int compute_y_pos_by_center(int16_t y, int16_t height) { return y - height / 2; } |
|
|
|
|
|
|
|
void dsp_mgr_change_to_preparePage() { |
|
|
|
ssd1306_basic_clear(); |
|
|
|
uint8_t x = 0; |
|
|
|
uint8_t y = 0; |
|
|
|
uint8_t xchange, ychange; |
|
|
|
|
|
|
|
// ssd1306_basic_draw_str(&x, &y, "123", &fontclocklib); |
|
|
|
ssd1306_basic_draw_str(x, y, &xchange, &ychange, "ooox", &font8x8_xo_lib); |
|
|
|
y = y + font8x8_xo_lib.heightPixel; |
|
|
|
x = x + font8x8_xo_lib.widthPixel; |
|
|
|
ssd1306_basic_draw_str(x, y, &xchange, &ychange, "±£³Ö¾²Ö¹", &font24x24_zh_lib); |
|
|
|
ssd1306_basic_gram_update(); |
|
|
|
dsp_mgr_change_to_page(kPage_preparePage); |
|
|
|
} |
|
|
|
static wave_drawer_t wave_drawer; |
|
|
|
|
|
|
|
void dsp_mgr_change_to_sampling() { // |
|
|
|
|
|
|
|
wave_drawer_init(&wave_drawer, 1, 1, 120, 40); |
|
|
|
wave_drawer_draw_border(&wave_drawer); |
|
|
|
|
|
|
|
uint8_t xchange, ychange; |
|
|
|
|
|
|
|
ssd1306_basic_draw_progress(1, 47, 80, 8, 50, 30); |
|
|
|
|
|
|
|
ssd1306_basic_draw_str(82, 43, &xchange, &ychange, "<>123", &font_asicc16x8_lib); |
|
|
|
ssd1306_basic_gram_update(); |
|
|
|
} |
|
|
|
|
|
|
|
void dsp_mgr_draw_point(int16_t y) { |
|
|
|
wave_drawer_draw_next_point(&wave_drawer, y); |
|
|
|
ssd1306_basic_gram_update(); |
|
|
@ -231,6 +204,61 @@ void mainPage_show(bool colon_state) { |
|
|
|
void dsp_mgr_change_to_main() { mainPage_show(true); } |
|
|
|
void mainPage_updateState() { mainPage_show(!m_main_page_colon_state); } |
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
|
* ±£³Ö¾²Ö¹Ò³Ãæ * |
|
|
|
*******************************************************************************/ |
|
|
|
static int m_prepare_page_progress = 0; |
|
|
|
void PreparePage_show(int progress) { |
|
|
|
m_prepare_page_progress = progress; |
|
|
|
ssd1306_basic_clear_gram(); |
|
|
|
uint8_t x = 0; |
|
|
|
uint8_t y = 0; |
|
|
|
uint8_t xchange, ychange; |
|
|
|
|
|
|
|
x = compute_x_pos_by_center(SCREEN_CENTER_X, font24x24_zh_lib.widthPixel * 4); |
|
|
|
y = compute_y_pos_by_center(SCREEN_CENTER_Y, font24x24_zh_lib.heightPixel); |
|
|
|
|
|
|
|
ssd1306_basic_draw_str(x, y, &xchange, &ychange, "±£³Ö¾²Ö¹", &font24x24_zh_lib); |
|
|
|
|
|
|
|
if (progress == 0) { |
|
|
|
ssd1306_basic_draw_str(x - font8x8_xo_lib.widthPixel, y - font8x8_xo_lib.heightPixel, &xchange, &ychange, "xxxx", &font8x8_xo_lib); |
|
|
|
} else if (progress == 1) { |
|
|
|
ssd1306_basic_draw_str(x - font8x8_xo_lib.widthPixel, y - font8x8_xo_lib.heightPixel, &xchange, &ychange, "oxxx", &font8x8_xo_lib); |
|
|
|
} else if (progress == 2) { |
|
|
|
ssd1306_basic_draw_str(x - font8x8_xo_lib.widthPixel, y - font8x8_xo_lib.heightPixel, &xchange, &ychange, "ooxx", &font8x8_xo_lib); |
|
|
|
} else if (progress == 3) { |
|
|
|
ssd1306_basic_draw_str(x - font8x8_xo_lib.widthPixel, y - font8x8_xo_lib.heightPixel, &xchange, &ychange, "ooox", &font8x8_xo_lib); |
|
|
|
} else if (progress == 4) { |
|
|
|
ssd1306_basic_draw_str(x - font8x8_xo_lib.widthPixel, y - font8x8_xo_lib.heightPixel, &xchange, &ychange, "oooo", &font8x8_xo_lib); |
|
|
|
} |
|
|
|
|
|
|
|
ssd1306_basic_gram_update(); |
|
|
|
} |
|
|
|
|
|
|
|
void dsp_mgr_change_to_preparePage() { |
|
|
|
PreparePage_show(0); |
|
|
|
dsp_mgr_change_to_page(kPage_preparePage); |
|
|
|
} |
|
|
|
void dsp_mgr_preparePage_set_progress(int progress) { PreparePage_show(progress); } |
|
|
|
int dsp_mgr_preparePage_get_progress() { return m_prepare_page_progress; } |
|
|
|
|
|
|
|
void PreparePage_schedule() {} |
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
|
* ²ÉÑùÒ³Ãæ * |
|
|
|
*******************************************************************************/ |
|
|
|
void dsp_mgr_change_to_sampling() { // |
|
|
|
wave_drawer_init(&wave_drawer, 1, 1, 120, 40); |
|
|
|
wave_drawer_draw_border(&wave_drawer); |
|
|
|
|
|
|
|
uint8_t xchange, ychange; |
|
|
|
|
|
|
|
ssd1306_basic_draw_progress(1, 47, 80, 8, 50, 30); |
|
|
|
|
|
|
|
ssd1306_basic_draw_str(82, 43, &xchange, &ychange, "<>123", &font_asicc16x8_lib); |
|
|
|
ssd1306_basic_gram_update(); |
|
|
|
} |
|
|
|
|
|
|
|
void mainPage_schedule() { |
|
|
|
static uint32_t last_update_time = 0; |
|
|
|
if (znordic_haspassed_ms(last_update_time) < 300) { |
|
|
|