pull/13/head
ArjanteMarvelde 2021-04-19 22:24:03 +02:00
rodzic 5fe5d58af5
commit 253cb15c5b
2 zmienionych plików z 8 dodań i 7 usunięć

10
hmi.c
Wyświetl plik

@ -133,7 +133,7 @@ void hmi_handler(uint8_t event)
if (event==HMI_E_ENTER)
{
hmi_sub[hmi_state] = hmi_option; // Store option
SI_SETFREQ(0, 2*hmi_freq); // Commit frequency
SI_SETFREQ(0, 2*hmi_freq); // Commit frequency (x2 due to HW used)
}
if (event==HMI_E_ESCAPE)
{
@ -290,13 +290,9 @@ void hmi_init(void)
gpio_set_irq_enabled_with_callback(GP_ENC_A, GPIO_IRQ_EDGE_ALL, true, hmi_callback);
// Initialize LCD and set VFO
lcd_clear();
hmi_state = HMI_S_TUNE;
hmi_option = 4; // kHz digit
hmi_freq = 7074000UL;
hmi_evaluate();
hmi_option = 4; // Active kHz digit
hmi_freq = 7074000UL; // Initial frequency
SI_SETFREQ(0, 2*hmi_freq); // Set freq to 2*7074 kHz
SI_SETPHASE(0, 2); // Set phase to 180deg

5
lcd.c
Wyświetl plik

@ -153,6 +153,11 @@ void lcd_init(void)
txdata[1] = LCD_DISPLAYCONTROL | LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF;
i2c_write_blocking(i2c0, I2C_LCD, txdata, 2, false);
sleep_us(LCD_DELAY);
/* Display clear once more */
txdata[1] = LCD_CLEARDISPLAY;
i2c_write_blocking(i2c0, I2C_LCD, txdata, 2, false);
sleep_us(1530);
}
void lcd_clear(void)