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-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<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.g++"/>
</provider>
@ -17,7 +17,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<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.g++"/>
</provider>

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

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

@ -47,6 +47,7 @@
#define __SI4432__
#endif
#ifdef TINYSA4
//#define __DISABLE_HOT_INSERT__
#define __SI4463__
#define __SI4468__
#define __ADF4351__
@ -1570,6 +1571,7 @@ void rtc_set_time(uint32_t dr, uint32_t tr);
#include "../FatFs/diskio.h"
extern uint16_t sd_card_inserted_at_boot;
bool SD_Inserted(void);
void SD_PowerOff(void);
// Buffers for SD card use spi_buffer
#if SPI_BUFFER_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(buf1, FREQUENCIES_XPOS1, FREQUENCIES_YPOS);
ili9341_set_foreground(LCD_BRIGHT_COLOR_RED);
#ifdef TINYSA4
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);
}
} else
ili9341_drawstring(" ", p2 - 18*7, FREQUENCIES_YPOS);
#endif
}
@ -1884,7 +1885,10 @@ static const uint8_t sd_icon [] = {
else{
ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(4, SD_CARD_START, 16, 16);
SD_PowerOff();
#ifdef __DISABLE_HOT_INSERT__
sd_card_inserted_at_boot = false;
#endif
}
#endif
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)
{
#ifdef __DISABLE_HOT_INSERT__
if (!sd_card_inserted_at_boot) {
drawMessageBox("Warning:", "Restart tinySA to use SD card", 2000);
return FR_NOT_READY;
}
#endif
FRESULT res = f_mount(fs_volume, "", 1);
// fs_volume, fs_file and fs_filename stored at end of spi_buffer!!!!!
// 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_fill(4, SD_CARD_START, 16, 16);
touch_wait_release();
#ifdef __DISABLE_HOT_INSERT__
if (!sd_card_inserted_at_boot) {
drawMessageBox("Warning:", "Restart tinySA to use SD card", 2000);
return FALSE;
}
#endif
// uint32_t time = chVTGetSystemTimeX();
// shell_printf("Screenshot\r\n");
FRESULT res = open_file("bmp");
@ -2339,7 +2342,11 @@ static void extcb1(EXTDriver *extp, expchannel_t channel)
{
(void)extp;
(void)channel;
if (channel != 9)
#ifdef __USE_SD_CARD__
if (channel == 12)
SD_PowerOff();
#endif
if (channel < 9)
operation_requested|=OP_LEVER;
// cur_button = READ_PORT() & BUTTON_MASK;
}
@ -2362,7 +2369,11 @@ static const EXTConfig extcfg = {
#endif
{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},
#endif
{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){
return;
}
if (unlock_internals != 4321) {
if (unlock_internals != 5432) {
kp_help_text = "Internals access code";
ui_mode_keypad(KM_CODE);
if (uistat.value != 4321) {
if (uistat.value != 5432) {
return;
}
unlock_internals = 4321;
unlock_internals = 5432;
}
menu_push_submenu(menu_settings2);
}

Loading…
Cancel
Save

Powered by TurnKey Linux.