microwave simulator
Dependencies: C12832_lcd LM75B mbed
Revision 2:9f6bdaddefff, committed 2013-10-24
- Comitter:
- rabad1
- Date:
- Thu Oct 24 22:07:46 2013 +0000
- Parent:
- 1:fac01d40d819
- Commit message:
- updated comments
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 18 21:50:14 2013 +0000
+++ b/main.cpp Thu Oct 24 22:07:46 2013 +0000
@@ -96,6 +96,12 @@
unsigned long ulErrorCode = 0UL;
#endif /* DEBUG */
+/* Name: main()
+ * Desc: entry point of application. This will also invoke the microwave
+ * state machine and update output
+ * Inputs: none
+ * Outputs: none
+ */
int main()
{
unsigned int while_loop_counter = 0;
@@ -116,6 +122,11 @@
}
}
+/* Name: init_microwave()
+ * Desc: initializes the microwave state machine to STATUS_IDLE
+ * Inputs: none
+ * Outputs: none
+ */
void init_microwave(void)
{
ssCookingTime = 0L;
@@ -127,6 +138,11 @@
reset_wdog = FALSE;
}
+/* Name: press_left()
+ * Desc: ISR callback function for left button.
+ * Inputs: none
+ * Outputs: none
+ */
void press_left(void)
{
if ( opStatus == STATUS_DONE )
@@ -140,6 +156,11 @@
}
}
+/* Name: press_right()
+ * Desc: ISR callback function for right button.
+ * Inputs: none
+ * Outputs: none
+ */
void press_right(void)
{
if ( opStatus != STATUS_IDLE )
@@ -153,6 +174,11 @@
}
}
+/* Name: press_start()
+ * Desc: ISR callback function for start button.
+ * Inputs: none
+ * Outputs: none
+ */
void press_start(void)
{
if ( opStatus != STATUS_IDLE )
@@ -166,6 +192,11 @@
}
}
+/* Name: press_stop()
+ * Desc: ISR callback function for stop button.
+ * Inputs: none
+ * Outputs: none
+ */
void press_stop(void)
{
if ( opStatus == STATUS_IDLE )
@@ -182,6 +213,11 @@
}
}
+/* Name: press_door()
+ * Desc: ISR callback function for door button.
+ * Inputs: none
+ * Outputs: none
+ */
void press_door(void)
{
ucDoorStatus = !ucDoorStatus;
@@ -193,6 +229,12 @@
}
}
+/* Name: wdog_update()
+ * Desc: callback function for watchdog timer. This watchog updates the
+ * cooking time when the microwave is running (STATUS_COOKING).
+ * Inputs: none
+ * Outputs: none
+ */
void wdog_update(void)
{
if ( opStatus == STATUS_COOKING )
@@ -212,6 +254,12 @@
}
}
+/* Name: microwave_sm()
+ * Desc: This is the microwave state machine. It processes all input and
+ * updates all state variables.
+ * Inputs: none
+ * Outputs: none
+ */
void microwave_sm(void)
{
switch ( opStatus )
@@ -285,6 +333,11 @@
}
}
+/* Name: update_output()
+ * Desc: Updates all output based on status variables.
+ * Inputs: none
+ * Outputs: none
+ */
void update_output(void)
{
static unsigned char toggle_alarm = 0;