Small UI updates

pull/38/head
erikkaashoek 3 years ago
parent 6914853b70
commit 06b35e2ca7

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="164294660241561" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="317342379697931" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>
@ -17,7 +17,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="164294660241561" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="317342379697931" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>

@ -1456,7 +1456,7 @@ static void SD_PowerOn(void) {
} }
// Power off SD // Power off SD
static inline void SD_PowerOff(void) { void SD_PowerOff(void) {
Stat &= ~STA_POWER_ON; Stat &= ~STA_POWER_ON;
} }
@ -1477,6 +1477,8 @@ DWORD get_fattime (void) {
// diskio.c - Initialize SD // diskio.c - Initialize SD
DSTATUS disk_initialize(BYTE pdrv) { DSTATUS disk_initialize(BYTE pdrv) {
if (CardType && (Stat & STA_POWER_ON))
return 0;
// Debug counters // Debug counters
#if DEBUG == 1 #if DEBUG == 1
w_cnt = 0; w_cnt = 0;

@ -73,7 +73,9 @@ static volatile vna_shellcmd_t shell_function = 0;
#endif #endif
#ifdef __USE_SD_CARD__ #ifdef __USE_SD_CARD__
#ifdef __DISABLE_HOT_INSERT__
uint16_t sd_card_inserted_at_boot = false; uint16_t sd_card_inserted_at_boot = false;
#endif
// Enable SD card console command // Enable SD card console command
#define ENABLE_SD_CARD_CMD #define ENABLE_SD_CARD_CMD
#endif #endif
@ -2620,8 +2622,9 @@ int main(void)
PULSE PULSE
ili9341_drawstring("Starting...", 0,0); ili9341_drawstring("Starting...", 0,0);
PULSE PULSE
#ifdef __DISABLE_HOT_INSERT__
sd_card_inserted_at_boot = SD_Inserted(); sd_card_inserted_at_boot = SD_Inserted();
#endif
disk_initialize(0); disk_initialize(0);
PULSE PULSE
// SD_PowerOn(); // SD_PowerOn();

@ -47,6 +47,7 @@
#define __SI4432__ #define __SI4432__
#endif #endif
#ifdef TINYSA4 #ifdef TINYSA4
//#define __DISABLE_HOT_INSERT__
#define __SI4463__ #define __SI4463__
#define __SI4468__ #define __SI4468__
#define __ADF4351__ #define __ADF4351__
@ -1570,6 +1571,7 @@ void rtc_set_time(uint32_t dr, uint32_t tr);
#include "../FatFs/diskio.h" #include "../FatFs/diskio.h"
extern uint16_t sd_card_inserted_at_boot; extern uint16_t sd_card_inserted_at_boot;
bool SD_Inserted(void); bool SD_Inserted(void);
void SD_PowerOff(void);
// Buffers for SD card use spi_buffer // Buffers for SD card use spi_buffer
#if SPI_BUFFER_SIZE < 2048 #if SPI_BUFFER_SIZE < 2048
#error "SPI_BUFFER_SIZE for SD card support need size >= 2048" #error "SPI_BUFFER_SIZE for SD card support need size >= 2048"

@ -1841,11 +1841,12 @@ draw_frequencies(void)
// } // }
ili9341_drawstring(buf2, p2, FREQUENCIES_YPOS); ili9341_drawstring(buf2, p2, FREQUENCIES_YPOS);
ili9341_drawstring(buf1, FREQUENCIES_XPOS1, FREQUENCIES_YPOS); ili9341_drawstring(buf1, FREQUENCIES_XPOS1, FREQUENCIES_YPOS);
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
#ifdef TINYSA4 #ifdef TINYSA4
if (get_sweep_frequency(ST_STOP) > 2000000000ULL && setting.attenuate_x2 >= 16 ) { if (get_sweep_frequency(ST_STOP) > 2000000000ULL && setting.attenuate_x2 >= 16 ) {
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
ili9341_drawstring("REDUCED LINEARITY", p2 - 18*7, FREQUENCIES_YPOS); ili9341_drawstring("REDUCED LINEARITY", p2 - 18*7, FREQUENCIES_YPOS);
} } else
ili9341_drawstring(" ", p2 - 18*7, FREQUENCIES_YPOS);
#endif #endif
} }
@ -1884,7 +1885,10 @@ static const uint8_t sd_icon [] = {
else{ else{
ili9341_set_background(LCD_BG_COLOR); ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(4, SD_CARD_START, 16, 16); ili9341_fill(4, SD_CARD_START, 16, 16);
SD_PowerOff();
#ifdef __DISABLE_HOT_INSERT__
sd_card_inserted_at_boot = false; sd_card_inserted_at_boot = false;
#endif
} }
#endif #endif
int16_t vbat = adc_vbat_read(); int16_t vbat = adc_vbat_read();

15
ui.c

@ -2101,11 +2101,12 @@ static const uint8_t bmp_header_v4[14+56] = {
FRESULT open_file(char *ext) FRESULT open_file(char *ext)
{ {
#ifdef __DISABLE_HOT_INSERT__
if (!sd_card_inserted_at_boot) { if (!sd_card_inserted_at_boot) {
drawMessageBox("Warning:", "Restart tinySA to use SD card", 2000); drawMessageBox("Warning:", "Restart tinySA to use SD card", 2000);
return FR_NOT_READY; return FR_NOT_READY;
} }
#endif
FRESULT res = f_mount(fs_volume, "", 1); FRESULT res = f_mount(fs_volume, "", 1);
// fs_volume, fs_file and fs_filename stored at end of spi_buffer!!!!! // fs_volume, fs_file and fs_filename stored at end of spi_buffer!!!!!
// shell_printf("Mount = %d\r\n", res); // shell_printf("Mount = %d\r\n", res);
@ -2141,10 +2142,12 @@ made_screenshot(int touch_x, int touch_y)
ili9341_set_background(LCD_BG_COLOR); ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(4, SD_CARD_START, 16, 16); ili9341_fill(4, SD_CARD_START, 16, 16);
touch_wait_release(); touch_wait_release();
#ifdef __DISABLE_HOT_INSERT__
if (!sd_card_inserted_at_boot) { if (!sd_card_inserted_at_boot) {
drawMessageBox("Warning:", "Restart tinySA to use SD card", 2000); drawMessageBox("Warning:", "Restart tinySA to use SD card", 2000);
return FALSE; return FALSE;
} }
#endif
// uint32_t time = chVTGetSystemTimeX(); // uint32_t time = chVTGetSystemTimeX();
// shell_printf("Screenshot\r\n"); // shell_printf("Screenshot\r\n");
FRESULT res = open_file("bmp"); FRESULT res = open_file("bmp");
@ -2339,7 +2342,11 @@ static void extcb1(EXTDriver *extp, expchannel_t channel)
{ {
(void)extp; (void)extp;
(void)channel; (void)channel;
if (channel != 9) #ifdef __USE_SD_CARD__
if (channel == 12)
SD_PowerOff();
#endif
if (channel < 9)
operation_requested|=OP_LEVER; operation_requested|=OP_LEVER;
// cur_button = READ_PORT() & BUTTON_MASK; // cur_button = READ_PORT() & BUTTON_MASK;
} }
@ -2362,7 +2369,11 @@ static const EXTConfig extcfg = {
#endif #endif
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL},
#ifdef __USE_SD_CARD__
{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},

@ -603,13 +603,13 @@ static UI_FUNCTION_ADV_CALLBACK(menu_internals_acb)
if (b){ if (b){
return; return;
} }
if (unlock_internals != 4321) { if (unlock_internals != 5432) {
kp_help_text = "Internals access code"; kp_help_text = "Internals access code";
ui_mode_keypad(KM_CODE); ui_mode_keypad(KM_CODE);
if (uistat.value != 4321) { if (uistat.value != 5432) {
return; return;
} }
unlock_internals = 4321; unlock_internals = 5432;
} }
menu_push_submenu(menu_settings2); menu_push_submenu(menu_settings2);
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.