fremoclock
1_3A01
FREMO Clock - Software for UTG
Main Page
Related Pages
Data Structures
Files
File List
Globals
main.c
Go to the documentation of this file.
1
24
/*
25
Copyright (C) 2006 Bernd Wisotzki
26
27
This library is free software; you can redistribute it and/or
28
modify it under the terms of the GNU Lesser General Public
29
License as published by the Free Software Foundation; either
30
version 2.1 of the License, or (at your option) any later version.
31
32
This library is distributed in the hope that it will be useful,
33
but WITHOUT ANY WARRANTY; without even the implied warranty of
34
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35
Lesser General Public License for more details.
36
37
You should have received a copy of the GNU Lesser General Public
38
License along with this library; if not, write to the Free Software
39
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40
*/
41
42
#include <avr/interrupt.h>
// sei() interrupt enable flag
43
#include "
SysHwTimer.h
"
// HwTimerInit()
44
#include "
UserInterfaceMenu.h
"
// typedef menuResult_t
45
// UserInterfaceBasicInit(),
46
// UserInterfaceMenuEndOfSoap(),
47
// UserInterfaceMenuNormal(),
48
// UserInterfaceMenuProg
49
// UserInterfaceMenuShutdown(),
50
// UserInterfaceMenuStartup(),
51
// UserInterfaceMenuWelcome(),
52
// UserInterfaceMenuWelcome()
53
54
// suppress gcc warning: "return type of 'main' is not 'int'"
55
#pragma GCC diagnostic ignored "-Wmain"
56
66
void
main
(
void
)
67
{
68
// local variables
69
menuResult_t
ucMenuShutdownResult;
70
menuResult_t
ucMenuResult;
71
72
// initialize basic functions of megaxxx
73
UserInterfaceBasicInit
();
74
75
// Init system timer and enable interrupts.
76
HwTimerInit
();
77
sei();
78
79
// Welcome message
80
UserInterfaceMenuWelcome
();
81
82
// Startup of application
83
ucMenuResult =
UserInterfaceMenuStartup
();
// NORMAL or PROG
84
85
// now starting normal operation
86
do
// until shutdown completed
87
{
88
do
// until shutdown
89
{
90
if
(ucMenuResult ==
MENU_RES_PROG
)
91
{
92
ucMenuResult =
UserInterfaceMenuProg
();
// NORMAL or SHUTDOWN
93
}
94
else
//(ucMenuResult == MENU_RES_NORMAL)
95
{
96
ucMenuResult =
UserInterfaceMenuNormal
();
// PROG or SHUTDOWN
97
}
98
}
while
( (ucMenuResult ==
MENU_RES_NORMAL
)
99
|| (ucMenuResult ==
MENU_RES_PROG
) );
100
// shutdown of application
101
ucMenuShutdownResult =
UserInterfaceMenuShutdown
();
// BACK or SHUTDOWN
102
}
while
(ucMenuShutdownResult ==
MENU_RES_BACK
);
103
104
UserInterfaceMenuEndOfSoap
();
105
// normal termination will result in interrupts disabled and endless loop
106
}
UserInterfaceMenuStartup
menuResult_t UserInterfaceMenuStartup(void)
Display Startup Menu ("Init") and initialize from EEPROM.
Definition:
UserInterfaceMenu.c:110
UserInterfaceMenu.h
Subroutines for UserInterfaceMenu.
MENU_RES_NORMAL
User has selected "Norml" in sub menu.
Definition:
UserInterfaceMenu.h:59
UserInterfaceMenuEndOfSoap
void UserInterfaceMenuEndOfSoap(void)
Shutdown, write to EEPROM and display EndOfSoap.
Definition:
UserInterfaceMenu.c:252
UserInterfaceMenuShutdown
menuResult_t UserInterfaceMenuShutdown(void)
Prepare shutdown.
Definition:
UserInterfaceMenu.c:218
UserInterfaceMenuNormal
menuResult_t UserInterfaceMenuNormal(void)
Normal operation.
Definition:
UserInterfaceMenu.c:147
menuResult_t
menuResult_t
Enum used for return values from sub menus.
Definition:
UserInterfaceMenu.h:58
MENU_RES_BACK
User has selected "Zurck" in sub menu.
Definition:
UserInterfaceMenu.h:62
UserInterfaceMenuWelcome
void UserInterfaceMenuWelcome(void)
Send a welcome message to LCD.
Definition:
UserInterfaceMenu.c:85
MENU_RES_PROG
User has selected "Progr" in sub menu.
Definition:
UserInterfaceMenu.h:60
SysHwTimer.h
Hardware dependent timer module for Atmel AVR.
UserInterfaceMenuProg
menuResult_t UserInterfaceMenuProg(void)
Display Programming Menu ("Progr").
Definition:
UserInterfaceMenu.c:184
UserInterfaceBasicInit
void UserInterfaceBasicInit(void)
Init all the basic HW and.
Definition:
UserInterfaceMenu.c:71
main
void main(void)
Entry point of the application.
Definition:
main.c:66
HwTimerInit
void HwTimerInit(void)
Initialize the hardware time.
Definition:
SysHwTimer.c:115
main.c
Generated on Sat Sep 3 2016 10:08:07 for fremoclock by
1.8.11