High outputlevels and waterfall fix

tinySA
erikkaashoek 6 years ago
parent 6a4daa8c94
commit 92119ca101

@ -467,7 +467,17 @@ void ili9341_read_memory(int x, int y, int w, int h, int len, uint16_t *out)
dmaStreamEnable(dmarx); dmaStreamEnable(dmarx);
// Wait DMA completion // Wait DMA completion
dmaWaitCompletion(dmatx); dmaWaitCompletion(dmatx);
#if 1
int count = 0;
while ((dmarx)->channel->CNDTR > 0U) {
chThdSleepMicroseconds(100);
if (count++ > 10)
break;
}
dmaStreamDisable(dmarx);
#else
dmaWaitCompletion(dmarx); dmaWaitCompletion(dmarx);
#endif;
chSysUnlock(); chSysUnlock();
CS_HIGH; CS_HIGH;

@ -1469,11 +1469,13 @@ draw_all_cells(bool flush_markmap)
clear_markmap(); clear_markmap();
} }
#ifdef __SCROLL__ #ifdef __SCROLL__
int w = area_width - 5;
if (w < 5) w = 5;
if (waterfall) { if (waterfall) {
for (m = 226; m >= HEIGHT+3; m -= 1) { // Scroll down for (m = 226; m >= HEIGHT+3; m -= 1) { // Scroll down
uint16_t *buf = &spi_buffer[0]; uint16_t *buf = &spi_buffer[0];
ili9341_read_memory(5*5, m, 290, 1, 290, buf); ili9341_read_memory(5*5, m, w, 1, w, buf);
ili9341_bulk(5*5,m+1, 290,1); ili9341_bulk(5*5,m+1, w,1);
} }
for (int i=0; i<290; i++) { // Add new topline for (int i=0; i<290; i++) { // Add new topline
#if 0 #if 0
@ -1510,7 +1512,7 @@ draw_all_cells(bool flush_markmap)
#endif #endif
spi_buffer[i] = RGB565(r,g,b); spi_buffer[i] = RGB565(r,g,b);
} }
ili9341_bulk(5*5,HEIGHT+3, 290,1); ili9341_bulk(5*5,HEIGHT+3, w,1);
} }
#endif #endif
} }

@ -318,9 +318,6 @@ static void menu_reffer_cb(int item, uint8_t data)
// draw_cal_status(); // draw_cal_status();
} }
//const int menu_drive_value[]={5,10,15,20};
const char *menu_drive_text[]={"-15dBm","-10dBm","-5dBm","0dBm","5dBm","10dBm","15dBm","20dBm"};
static void menu_drive_cb(int item, uint8_t data) static void menu_drive_cb(int item, uint8_t data)
{ {
(void)item; (void)item;
@ -523,6 +520,11 @@ static void menu_pause_cb(int item, uint8_t data)
// draw_cal_status(); // draw_cal_status();
} }
//const int menu_drive_value[]={5,10,15,20};
const char *menu_drive_text[]={"-24dBm","-20dBm","-16dBm","-12dBm"," 6dBm"," 10dBm"," 14dBm"," 18dBm"};
// ===[MENU DEFINITION]========================================================= // ===[MENU DEFINITION]=========================================================
static const menuitem_t menu_drive[] = { static const menuitem_t menu_drive[] = {
@ -530,18 +532,26 @@ static const menuitem_t menu_drive[] = {
{ MT_CALLBACK, 2, " 15dBm", menu_drive_cb}, { MT_CALLBACK, 2, " 15dBm", menu_drive_cb},
{ MT_CALLBACK, 1, " 10dBm", menu_drive_cb}, { MT_CALLBACK, 1, " 10dBm", menu_drive_cb},
{ MT_CALLBACK, 0, " 5dBm", menu_drive_cb}, { MT_CALLBACK, 0, " 5dBm", menu_drive_cb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_CANCEL, 255, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_drive_wide2[] = {
{ MT_FORM | MT_CALLBACK, 2, "-16dBm", menu_drive_cb },
{ MT_FORM | MT_CALLBACK, 1, "-20dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 0, "-24dBm", menu_drive_cb},
{ MT_FORM | MT_CANCEL, 255, S_LARROW" BACK", NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
};
static const menuitem_t menu_drive_wide[] = { static const menuitem_t menu_drive_wide[] = {
{ MT_FORM | MT_CALLBACK, 6, " 15dBm", menu_drive_cb}, { MT_FORM | MT_CALLBACK, 7, " 18dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 6, " 14dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 5, " 10dBm", menu_drive_cb}, { MT_FORM | MT_CALLBACK, 5, " 10dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 4, " 5dBm", menu_drive_cb}, { MT_FORM | MT_CALLBACK, 4, " 6dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 2, " -5dBm", menu_drive_cb}, { MT_FORM | MT_CALLBACK, 3, "-12dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 1, "-10dBm", menu_drive_cb}, { MT_FORM | MT_SUBMENU, 255, S_RARROW" MORE", menu_drive_wide2},
{ MT_FORM | MT_CALLBACK, 0, "-15dBm", menu_drive_cb}, { MT_FORM | MT_CANCEL, 255, S_LARROW" BACK", NULL },
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -939,7 +949,7 @@ static void menu_item_modify_attribute(
mark = true; mark = true;
} }
} else if (menu == menu_drive || menu == menu_drive_wide) { } else if (menu == menu_drive || menu == menu_drive_wide || menu == menu_drive_wide2) {
if (menu[item].data == setting_drive){ if (menu[item].data == setting_drive){
mark = true; mark = true;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.