Sleep while waiting for CTS

Removed_REF_marker
erikkaashoek 5 years ago
parent 915e05df37
commit 57e71a4476

@ -86,6 +86,7 @@
#define DB_PER_DEGREE_BELOW 0.056 #define DB_PER_DEGREE_BELOW 0.056
#define DB_PER_DEGREE_ABOVE 0.069 #define DB_PER_DEGREE_ABOVE 0.069
#define CENTER_TEMPERATURE 34.0 #define CENTER_TEMPERATURE 34.0
#define __WAIT_CTS_WHILE_SLEEPING__
#else #else
#endif #endif

@ -566,7 +566,11 @@ static si446x_state_t SI4463_get_state(void);
static void SI4463_set_state(si446x_state_t); static void SI4463_set_state(si446x_state_t);
#define SI4463_READ_CTS (palReadLine(LINE_RX_CTS)) #define SI4463_READ_CTS (palReadLine(LINE_RX_CTS))
#define SI4463_WAIT_CTS while (!SI4463_READ_CTS); #ifdef __WAIT_CTS_WHILE_SLEEPING__
#define SI4463_WAIT_CTS while (!SI4463_READ_CTS) __WFI();
#else
#define SI4463_WAIT_CTS while (!SI4463_READ_CTS) ;
#endif
#if 0 // not used #if 0 // not used
static void SI4463_write_byte(uint8_t ADR, uint8_t DATA) static void SI4463_write_byte(uint8_t ADR, uint8_t DATA)

11
ui.c

@ -2920,6 +2920,8 @@ made_screenshot(int touch_x, int touch_y)
UINT size; UINT size;
if (touch_y < SD_CARD_START || touch_y > SD_CARD_START + 20 || touch_x > OFFSETX) if (touch_y < SD_CARD_START || touch_y > SD_CARD_START + 20 || touch_x > OFFSETX)
return FALSE; return FALSE;
ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(4, SD_CARD_START, 16, 16);
touch_wait_release(); touch_wait_release();
// uint32_t time = chVTGetSystemTimeX(); // uint32_t time = chVTGetSystemTimeX();
// shell_printf("Screenshot\r\n"); // shell_printf("Screenshot\r\n");
@ -2952,7 +2954,7 @@ made_screenshot(int touch_x, int touch_y)
} }
// time = chVTGetSystemTimeX() - time; // time = chVTGetSystemTimeX() - time;
// shell_printf("Total time: %dms (write %d byte/sec)\r\n", time/10, (LCD_WIDTH*LCD_HEIGHT*sizeof(uint16_t)+sizeof(bmp_header_v4))*10000/time); // shell_printf("Total time: %dms (write %d byte/sec)\r\n", time/10, (LCD_WIDTH*LCD_HEIGHT*sizeof(uint16_t)+sizeof(bmp_header_v4))*10000/time);
drawMessageBox("SCREENSHOT", res == FR_OK ? fs_filename : " Fail write ", 2000); drawMessageBox("SCREENSHOT", res == FR_OK ? fs_filename : " Write failed ", 2000);
redraw_request|= REDRAW_AREA; redraw_request|= REDRAW_AREA;
return TRUE; return TRUE;
} }
@ -3118,7 +3120,8 @@ static void extcb1(EXTDriver *extp, expchannel_t channel)
{ {
(void)extp; (void)extp;
(void)channel; (void)channel;
operation_requested|=OP_LEVER; if (channel != 9)
operation_requested|=OP_LEVER;
// cur_button = READ_PORT() & BUTTON_MASK; // cur_button = READ_PORT() & BUTTON_MASK;
} }
@ -3133,7 +3136,11 @@ static const EXTConfig extcfg = {
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},
#ifdef __WAIT_CTS_WHILE_SLEEPING__
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, extcb1},
#else
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},
#endif
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},

Loading…
Cancel
Save

Powered by TurnKey Linux.