tinySA3 cal change, UI bug

pull/34/head
erikkaashoek 4 years ago
parent cf98b9c010
commit 57fd136d84

@ -2435,16 +2435,36 @@ static void dac_init(void){
rccEnableDAC1(false); // Enable DAC1 rccEnableDAC1(false); // Enable DAC1
} }
#ifdef TINYSA4__
#define PULSE { palClearPad(GPIOB, 14); my_microsecond_delay(2); palSetPad(GPIOB, 14); }
#else
#define PULSE
#endif
int main(void) int main(void)
{ {
halInit(); halInit();
/*
* Initiate 1 micro second timer
*/
#ifdef TINYSA4
gptStart(&GPTD4, &gpt4cfg);
gptPolledDelay(&GPTD4, 10); // 10 us delay
#else
gptStart(&GPTD14, &gpt4cfg);
gptPolledDelay(&GPTD14, 10); // 10 us delay
#endif
PULSE
chSysInit(); chSysInit();
PULSE
/* /*
* Initialize RTC library (not used ChibiOS RTC module) * Initialize RTC library (not used ChibiOS RTC module)
*/ */
#ifdef __USE_RTC__ #ifdef __USE_RTC__
rtc_init(); rtc_init();
#endif #endif
PULSE
//palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN); //palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN);
//palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN); //palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN);
@ -2499,6 +2519,7 @@ int main(void)
#endif #endif
spi_init(); spi_init();
PULSE
/* /*
@ -2506,6 +2527,7 @@ int main(void)
* Starting DAC1 driver, setting up the output pin as analog as suggested by the Reference Manual. * Starting DAC1 driver, setting up the output pin as analog as suggested by the Reference Manual.
*/ */
dac_init(); dac_init();
PULSE
DAC->CR|= DAC_CR_EN1 | DAC_CR_EN2; // Use DAC: CH1 and CH2 DAC->CR|= DAC_CR_EN1 | DAC_CR_EN2; // Use DAC: CH1 and CH2
#ifdef __LCD_BRIGHTNESS__ #ifdef __LCD_BRIGHTNESS__
lcd_setBrightness(DEFAULT_BRIGHTNESS); lcd_setBrightness(DEFAULT_BRIGHTNESS);
@ -2516,12 +2538,16 @@ int main(void)
* SPI LCD Initialize * SPI LCD Initialize
*/ */
ili9341_init(); ili9341_init();
PULSE
#ifdef TINYSA4 #ifdef TINYSA4
ili9341_set_foreground(LCD_FG_COLOR); ili9341_set_foreground(LCD_FG_COLOR);
PULSE
ili9341_drawstring("Starting...", 0,0); ili9341_drawstring("Starting...", 0,0);
PULSE
disk_initialize(0); disk_initialize(0);
PULSE
// SD_PowerOn(); // SD_PowerOn();
#endif #endif

@ -18,7 +18,7 @@
*/ */
#include "ch.h" #include "ch.h"
//#ifdef TINYSA_F303 #ifdef TINYSA_F303
#ifdef TINYSA_F072 #ifdef TINYSA_F072
#error "Remove comment for #ifdef TINYSA_F303" #error "Remove comment for #ifdef TINYSA_F303"
#endif #endif
@ -26,7 +26,7 @@
#define TINYSA4 #define TINYSA4
#endif #endif
#define TINYSA4_PROTO #define TINYSA4_PROTO
//#endif #endif
#ifdef TINYSA_F072 #ifdef TINYSA_F072
#ifdef TINYSA_F303 #ifdef TINYSA_F303

@ -7122,8 +7122,12 @@ again:
set_attenuation(10); set_attenuation(10);
#endif #endif
set_sweep_frequency(ST_CENTER, 30000000); set_sweep_frequency(ST_CENTER, 30000000);
#ifdef TINYSA4
set_sweep_frequency(ST_SPAN, 10000); set_sweep_frequency(ST_SPAN, 10000);
markers[0].mtype |= M_AVER; markers[0].mtype |= M_AVER;
#else
set_sweep_frequency(ST_SPAN, 5000000);
#endif
setting.rbw_x10 = 3000; setting.rbw_x10 = 3000;
setting.repeat = 10; setting.repeat = 10;
int test_case = TEST_POWER; int test_case = TEST_POWER;

@ -3249,7 +3249,7 @@ static void fetch_numeric_target(uint8_t mode)
switch (mode) { switch (mode) {
case KM_START: case KM_START:
uistat.freq_value = get_sweep_frequency(ST_START) + (setting.frequency_offset - FREQUENCY_SHIFT); uistat.freq_value = get_sweep_frequency(ST_START) + (setting.frequency_offset - FREQUENCY_SHIFT);
plot_printf(uistat.text, sizeof uistat.text, "%.3QMHz", uistat.freq_value); plot_printf(uistat.text, sizeof uistat.text, "%.3QHz", uistat.freq_value);
break; break;
case KM_STOP: case KM_STOP:
uistat.freq_value = get_sweep_frequency(ST_STOP) + (setting.frequency_offset - FREQUENCY_SHIFT); uistat.freq_value = get_sweep_frequency(ST_STOP) + (setting.frequency_offset - FREQUENCY_SHIFT);

Loading…
Cancel
Save

Powered by TurnKey Linux.