Merge branch 'tinySA' into tinySA-v0.2

tinySA-v0.2
erikkaashoek 6 years ago
commit 4f8108d76d

@ -452,6 +452,7 @@ void ili9341_read_memory(int x, int y, int w, int h, int len, uint16_t *out)
// Skip SPI rx buffer
while (SPI_RX_IS_NOT_EMPTY) (void)SPI_READ_DATA;
// Init Rx DMA buffer, size, mode (spi and mem data size is 8 bit)
chSysLock();
dmaStreamSetMemory0(dmarx, rgbbuf);
dmaStreamSetTransactionSize(dmarx, data_size);
dmaStreamSetMode(dmarx, rxdmamode | STM32_DMA_CR_PSIZE_BYTE | STM32_DMA_CR_MSIZE_BYTE |
@ -466,7 +467,18 @@ void ili9341_read_memory(int x, int y, int w, int h, int len, uint16_t *out)
dmaStreamEnable(dmarx);
// Wait DMA completion
dmaWaitCompletion(dmatx);
#if 1
int count = 0;
while ((dmarx)->channel->CNDTR > 0U) {
chThdSleepMicroseconds(100);
if (count++ > 10)
break;
}
dmaStreamDisable(dmarx);
#else
dmaWaitCompletion(dmarx);
#endif;
chSysUnlock();
CS_HIGH;
// Parce recived data

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

@ -318,9 +318,6 @@ static void menu_reffer_cb(int item, uint8_t data)
// 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)
{
(void)item;
@ -523,6 +520,11 @@ static void menu_pause_cb(int item, uint8_t data)
// 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]=========================================================
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, 1, " 10dBm", 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
};
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[] = {
{ 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, 4, " 5dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 2, " -5dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 1, "-10dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 0, "-15dBm", menu_drive_cb},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_FORM | MT_CALLBACK, 4, " 6dBm", menu_drive_cb},
{ MT_FORM | MT_CALLBACK, 3, "-12dBm", menu_drive_cb},
{ MT_FORM | MT_SUBMENU, 255, S_RARROW" MORE", menu_drive_wide2},
{ MT_FORM | MT_CANCEL, 255, S_LARROW" BACK", NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
};
@ -939,7 +949,7 @@ static void menu_item_modify_attribute(
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){
mark = true;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.