#include <ctasksupervisor.h>


Public Member Functions | |
| CTaskSupervisor () | |
| virtual CMachine::bit32 | fault () |
| virtual CMachine::bit32 | init () |
| virtual bool | iowait () |
| void | irq (CMachine::InterruptVector v) |
| Handle hardware interrupts. | |
| virtual const char * | name () |
| virtual CMachine::bit32 | run () |
| Called periodically by CTaskScheduler to do a piece of work. | |
| virtual CMachine::bit32 | start () |
| virtual CMachine::bit32 | stop () |
| ~CTaskSupervisor () | |
Private Member Functions | |
| void | monitorPower () |
Private Attributes | |
| CBinaryInputGPIO * | mPowerFail [2] |
Definition at line 36 of file ctasksupervisor.h.
| PikeAero::CTaskSupervisor::CTaskSupervisor | ( | ) |
Handler for various interrupt sources
Enable the Power Fail Inputs...
Definition at line 28 of file ctasksupervisor.cpp.
References GPIO2, GPIO_PIN_12, GPIO_PIN_13, PikeAero::CMachine::installVectorIRQ(), mPowerFail, PikeAero::CMachine::Vector_CMU_PRCCU, PikeAero::CMachine::Vector_RTC, PikeAero::CMachine::Vector_SWI, and PikeAero::CMachine::Vector_WDG_WUT.
00029 : ITask() 00030 { 00031 /** Handler for various interrupt sources */ 00032 CMachine::installVectorIRQ(CMachine::Vector_CMU_PRCCU,this); 00033 CMachine::installVectorIRQ(CMachine::Vector_SWI,this); 00034 CMachine::installVectorIRQ(CMachine::Vector_RTC,this); 00035 CMachine::installVectorIRQ(CMachine::Vector_WDG_WUT,this); 00036 00037 /** Enable the Power Fail Inputs... */ 00038 mPowerFail[0] = new CBinaryInputGPIO( GPIO2, GPIO_PIN_12, false ); 00039 mPowerFail[1] = new CBinaryInputGPIO( GPIO2, GPIO_PIN_13, false ); 00040 }

| PikeAero::CTaskSupervisor::~CTaskSupervisor | ( | ) |
Definition at line 42 of file ctasksupervisor.cpp.
References stop().
00043 { 00044 stop(); 00045 }

| CMachine::bit32 PikeAero::CTaskSupervisor::fault | ( | ) | [virtual] |
The CTaskScheduler will call the fault() method when a fault code was returned by any of the task's other methods.
Reimplemented from PikeAero::ITask.
Definition at line 95 of file ctasksupervisor.cpp.
| CMachine::bit32 PikeAero::CTaskSupervisor::init | ( | ) | [virtual] |
called exactly once. perform task initialization such as initializing private variable. other tasks are not guaranteed so do not interract with other tasks at this stage.
Reimplemented from PikeAero::ITask.
Definition at line 52 of file ctasksupervisor.cpp.
| bool PikeAero::CTaskSupervisor::iowait | ( | ) | [virtual] |
The CTaskScheduler::iowait() method will call the task's iowait method periodically to test if the task is still in an I/O wait state.
Reimplemented from PikeAero::ITask.
Definition at line 105 of file ctasksupervisor.cpp.
| void PikeAero::CTaskSupervisor::irq | ( | CMachine::InterruptVector | v | ) | [virtual] |
Handle hardware interrupts.
Handle hardware interrupts.
CMU & PRCCU Interrupts
Clear the pending flags before returning
FXME - do stuff here
FXME - do stuff here
Clear the pending flag
Reimplemented from PikeAero::CObject.
Definition at line 113 of file ctasksupervisor.cpp.
References PRCCU, PRCCU_CK2_16_I, PRCCU_LOCK_I, PRCCU_STOP_I, PikeAero::CMachine::Vector_CMU_PRCCU, PikeAero::CMachine::Vector_RTC, PikeAero::CMachine::Vector_SWI, PikeAero::CMachine::Vector_WDG_WUT, WDG, and WDG_EC.
00114 { 00115 /** CMU & PRCCU Interrupts */ 00116 switch( v ) 00117 { 00118 case CMachine::Vector_CMU_PRCCU: 00119 /** Clear the pending flags before returning */ 00120 PRCCU->CFR |= ( PRCCU_STOP_I | PRCCU_CK2_16_I | PRCCU_LOCK_I ); 00121 break; 00122 case CMachine::Vector_SWI: 00123 /** FXME - do stuff here */ 00124 break; 00125 case CMachine::Vector_RTC: 00126 /** FXME - do stuff here */ 00127 break; 00128 case CMachine::Vector_WDG_WUT: 00129 /** Clear the pending flag */ 00130 WDG->SR &= ~WDG_EC; 00131 break; 00132 } 00133 }
| void PikeAero::CTaskSupervisor::monitorPower | ( | ) | [private] |
Monitor the Power Supply...
FIXME - do real power supply failure handling here - try toggling the power supply in question with a one second delay
FIXME - do stuff
Definition at line 138 of file ctasksupervisor.cpp.
References mPowerFail.
Referenced by run().
00139 { 00140 /** FIXME - do real power supply failure handling here - try toggling the power supply in question with a one second delay */ 00141 for( CMachine::ubit32 n=0; n < 2; n++ ) 00142 { 00143 if ( mPowerFail[n]->active() ) 00144 { 00145 /** FIXME - do stuff */ 00146 } 00147 } 00148 }

| virtual const char* PikeAero::CTaskSupervisor::name | ( | ) | [inline, virtual] |
Reimplemented from PikeAero::ITask.
Definition at line 43 of file ctasksupervisor.h.
| CMachine::bit32 PikeAero::CTaskSupervisor::run | ( | ) | [virtual] |
Called periodically by CTaskScheduler to do a piece of work.
called periodically by CTaskScheduler to do a piece of work.
0 on success.
dequeue events
monitor the power supply
Reimplemented from PikeAero::ITask.
Definition at line 70 of file ctasksupervisor.cpp.
References PikeAero::CEventQueue::dequeue(), and monitorPower().
00071 { 00072 /** dequeue events */ 00073 CEventQueue::dequeue(); 00074 00075 /** monitor the power supply */ 00076 monitorPower(); 00077 00078 return 0; 00079 }

| CMachine::bit32 PikeAero::CTaskSupervisor::start | ( | ) | [virtual] |
called exactly once. all tasks are initialized at this point. called just prior to first call to run()
Reimplemented from PikeAero::ITask.
Definition at line 61 of file ctasksupervisor.cpp.
| CMachine::bit32 PikeAero::CTaskSupervisor::stop | ( | ) | [virtual] |
The CTaskScheduler will call the stop () method after the task was scheduled for cancelation.
Reimplemented from PikeAero::ITask.
Definition at line 85 of file ctasksupervisor.cpp.
References PikeAero::CEventQueue::removeListener(), and PikeAero::CEvent::Tick.
Referenced by ~CTaskSupervisor().
00086 { 00087 CEventQueue::removeListener(this,CEvent::Tick); 00088 return 0; 00089 }


CBinaryInputGPIO* PikeAero::CTaskSupervisor::mPowerFail[2] [private] |
Definition at line 83 of file ctasksupervisor.h.
Referenced by CTaskSupervisor(), and monitorPower().
1.5.8