All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Classes | Public Member Functions | Static Public Member Functions
GpCoreTools::Leds Class Reference

Brief description of class still missing. More...

#include <Leds.h>

List of all members.

Classes

class  LedTimer

Public Member Functions

 Leds ()
 ~Leds ()

Static Public Member Functions

static void flash (int index, int msec, bool on)
static void power (int index, bool on)
static void timer (int index, int msecOn, int msecOff)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of constructor still missing

References GpCoreTools::Log::write().

{
  assert(!_self);

  // Test all 3 lights
  if(!test(0) || !test(1) || !test(2)) {
    Log::write(1, "no led available\n");
    // Do not initialize _self, leds are not available
    return;
  }

  _self=this;
  _timer[0]._index=0;
  _timer[1]._index=1;
  _timer[2]._index=2;
}
{_self=0;}

Member Function Documentation

void GpCoreTools::Leds::flash ( int  index,
int  msec,
bool  on 
) [static]

References power().

{
  if(_self) {
    LedTimer& t=_self->_timer[index];
    t._on=!on;
    t.setInterval(msec);
    t.start();
    _self->setTrigger(index, "default-on");
    power(index, on);
  }
}
void GpCoreTools::Leds::power ( int  index,
bool  on 
) [static]

Referenced by flash().

{
  if(_self) {
    _self->setTrigger(index, "default-on");
    _self->powerInternal(index, on);
  }
}
void GpCoreTools::Leds::timer ( int  index,
int  msecOn,
int  msecOff 
) [static]

Referenced by GpCoreTools::CoreApplication::exit().

{
  if(_self) {
    _self->setTrigger(index, "timer");
    _self->powerInternal(index, true);
    _self->setDelayOn(index, msecOn);
    _self->setDelayOff(index, msecOff);
  }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines