Stepper-Motor-Control  v3.0.0
System on a Chip 2014 - Group 04
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
switchesIRQhandler.c
Go to the documentation of this file.
1 /**
2  *****************************************************************************
3  * @file switchesIRQhandler.c
4  * @author Michael Riedel
5  * @author Marc Kossmann
6  * @version v1.0.0
7  * @date 11.11.2014
8  * @brief IRQ-handler for switches
9  *****************************************************************************
10  * @par History:
11  * @details v0.1.0 21.10.2014 Riedel & Kossmann
12  * - first draft for milestone 1b
13  * @details v0.1.1 27.10.2014 Riedel
14  * - basic implementation
15  * @details v0.1.2 29.10.2014 Kossmann
16  * - modified clearing requests and evaluating pressed keys
17  * @details v0.1.3 30.10.2014 Riedel
18  * - added Debug and Error-Handling
19  * @details v0.1.4 30.10.2014 Kossmann
20  * - change IPC to message queue because mailbox not needed
21  * @details v0.1.5 31.10.2014 Kossmann
22  * - fix bug that IRQhandler was called all the time
23  * @details v0.1.6 04.11.2014 Riedel & Kossmann
24  * - removed debug printouts because they are critical
25  * - added flushing queue before posting
26  * @details v1.0.0 11.11.2014 Riedel & Kossmann
27  * - replaced messageQueue with SW_UPDATE_EVENT
28  * - moved PIO_SW_GetValues() in InputTask
29  *****************************************************************************
30  */
31 
32 #include "../INC/switchesIRQhandler.h"
33 
34 void switchesIRQhandler(void *context) {
35  uint8_t err;
36 
37  OSIntEnter();
38 
39  OSFlagPost(userInputTaskFlagsGrp, SW_UPDATE_EVENT, OS_FLAG_SET, &err);
40  if (OS_NO_ERR != err) {
41  error("SW_ISR_FLAG_ERR: %i\n", err);
42  }
43  // reset IR-Bits
46 
47  OSIntExit();
48 }
#define error(...)
Prints the Error-messages in the terminal.
#define PIO_SW_DEBUG_MSK
Debug mask for PIO-Switches.
OS_FLAG_GRP * userInputTaskFlagsGrp
The flags group used in the user-input-task.
Definition: events.h:32
#define PIO_SW_MODE_MSK
Mode mask for PIO-Switches.
#define SW_UPDATE_EVENT
signalizes that switches changed
Definition: events.h:37
void switchesIRQhandler(void *context)
IRQ-Handler for switches.
#define PIO_SW_LR_MSK
Left/Right mask for PIO-Switches.
static __inline__ void PIO_SW_ClearEdgeCptBits(uint32_t clearbits)
Function to clear bits of switches edgecapture register.