-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.c
114 lines (101 loc) · 2.6 KB
/
ui.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
* ui.c
*
* Created on: 26.05.2012
*****************************************************************************
* MCmega - Firmware for the Motorola MC micro radio
* to use it as an Amateur-Radio transceiver
*
* Copyright (C) 2013 Felix Erckenbrecht, DG1YFE
*
* ( AVR port of "MC70"
* Copyright (C) 2004 - 2013 Felix Erckenbrecht, DG1YFE)
*
* This file is part of MCmega.
*
* MCmega is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MCmega is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MCmega. If not, see <http://www.gnu.org/licenses/>.
*
****************************************************************************
*/
#include <stdio.h>
#include <avr/pgmspace.h>
#include "FreeRTOS.h"
#include "task.h"
#include "macros.h"
#include "regmem.h"
#include "firmware.h"
#include "display.h"
#include "pll_freq.h"
#include "menu.h"
#include "int.h"
#include "io.h"
#include "subs.h"
#include "audio.h"
const char version_str[] PROGMEM = "14_1beta";
void init_ui()
{
}
// reset user interface
#define UI_RESET_COLD 1
#define UI_RESET_WARM 0
static void reset_ui(uint8_t type)
{
if(type == UI_RESET_COLD)
lcd_clr(LCD_CLEAR_LED); // clear lcd content including LEDs
else
lcd_cpos(0);
freq_print(&config.frequency); // print current frequency
vTaskDelay(15);
squelch_print();
rfpwr_print(); // print state of output power
freq_offset_print(); // print state of tx shift
pll_led(PLL_LOCK_STATE_FORCE_UPDATE);// force update of PLL led state
menu_init(); // (re-)initialize menu
}
void vUiTask( void * pvParameters)
{
lcd_s_reset();
// int_lcd_timer_dec = 1;
#ifdef DEBUG_BUILD
#else
led_update();
printf_P(PSTR("DG1YFE"));
lcd_fill();
lcd_cpos(0);
printf_P(PSTR("MCmega"));
lcd_fill();
lcd_cpos(0);
vTaskDelay(150);
printf_P(version_str);
lcd_fill();
vTaskDelay(150);
// reset_ui(UI_RESET_WARM);
#endif
reset_ui(UI_RESET_COLD);
for(;;)
{
pll_led(0);
led_update();
menu();
taskYIELD();
// check if reset of control head was detected
// (certain amount of 0x7e reset messages was received)
if(!ch_reset_detected)
{
lcd_s_reset();
reset_ui(UI_RESET_COLD);
}
config_validate();
}
}