fremoclock  1_3A01
FREMO Clock - Software for UTG
UserInterfaceMenuProgram.c
Go to the documentation of this file.
1 
24 /*
25  Copyright (C) 2007 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 /* -- System wide includes -------------------------------------------------- */
43 #include <stdint.h> // typedef uint8_t
44 
45 /* -- Special Includes e.g. Onboard or direct attached Equipment ------------ */
46 #include "ClockKernel.h" // #define CLOCK_PULSE_WIDTH_MIN,
47  // #define CLOCK_PULSE_WIDTH_MAX,
48  // #define CLOCK_MIDNIGHT,
49  // typedef fclock_t,
50  // ClockSetPulse(), ClockSetTime(),
51  // ClockReadPulse()
52 #include "PushButton.h" // PushButtonGetUpDownValue(),
53  // PushButtonSingleShotEnter(),
54  // PushButtonSingleShotBack(),
55 #include "UserInterfaceLcdProgram.h" // UserInterfaceLcdProgramPulseWidth()
56  // UserInterfaceLcdProgramSet0()
57 #include "UserInterfaceMenu.h" // typedef menuSet0_t
59 
60 /* -- Standard functions ---------------------------------------------------- */
61 
66 {
67  uint8_t pulseWidth = ClockReadPulse(); //FIXME returns uint16_t assigned to uint8_t
68  for(;;)
69  {
71  pulseWidth = PushButtonGetUpDownValue(pulseWidth,
74 
75  // single shot enter
77  {
78  ClockSetPulse(pulseWidth);
79  return;
80  }
81  // single shot back
83  {
84  return;
85  }
86  }
87 }
88 
93 {
94  menuSet0_t ucbut1 = MENU_SET0_BACK;
95 
96  for(;;)
97  {
101 
102  // single shot enter
104  {
105  if (ucbut1 == MENU_SET0_SET0)
106  {
108  }
109  return;
110  }
111  // single shot back
113  {
114  return;
115  }
116  }
117 }
Subroutines for UserInterfaceMenu Program.
void UserInterfaceLcdProgramSet0(menuSet0_t subMenuSelection)
Write on LCD "PrSe0" (set time to midnight).
bool PushButtonSingleShotBack(void)
Test if button back is pressed.
Definition: PushButton.c:158
Subroutines for UserInterfaceMenu.
A struct with hour and minute.
Definition: ClockKernel.h:69
void ClockSetTime(fclock_t newValue)
Set actual time.
Definition: ClockKernel.c:301
void UserInterfaceLcdProgramPulseWidth(uint8_t pulseWidth)
Write on LCD "PrPub" (edit pulse width).
Subroutines for access to LCD for Program.
void UserInterfaceMenuProgramSet0(void)
Set clock to 00:00.
Push button debouncing module for Atmel AVR.
uint8_t PushButtonGetUpDownValue(uint8_t ucbut, uint8_t ucmin, uint8_t ucmax)
Get selection value by up and down button.
Definition: PushButton.c:217
uint16_t ClockReadPulse(void)
Get length of pulse length in 100ms.
Definition: ClockKernel.c:286
#define CLOCK_MIDNIGHT
"00:00" alias "24:00"
Definition: ClockKernel.h:74
"Zurck" | Zurueck
#define CLOCK_PULSE_WIDTH_MIN
minimum pulse width in 0.1s (5 = 500ms)
Definition: ClockKernel.h:99
bool PushButtonSingleShotEnter(void)
Test if button enter is pressed.
Definition: PushButton.c:147
"PrSe0" | Aktuelle Zeit auf 00:00
void ClockSetPulse(uint16_t uiPulse)
Set length of pulse length in 100ms.
Definition: ClockKernel.c:270
menuSet0_t
Enum used for Menu setting time to midnight.
User function called by timer ISR.
void UserInterfaceMenueProgramPulseWidth(void)
Set pulse width.
#define CLOCK_PULSE_WIDTH_MAX
maximum pulse width in 0.1s (19 = 1.9s)
Definition: ClockKernel.h:100