本文整理汇总了C++中LedManager类的典型用法代码示例。如果您正苦于以下问题:C++ LedManager类的具体用法?C++ LedManager怎么用?C++ LedManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LedManager类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blinkLed
static void blinkLed(void)
{
// This function only works the first time, when all the LEDs are assigned to
// LedStimulus::Off, and OneShot turns them on for one blink
ledmanager.publish(LEDSTIMULUS_Off, LEDACTION_OneShot);
ledmanager.doWork();
}
示例2: checkAlarms
static void checkAlarms(void)
{
boolean anyRinging = false;
for (unsigned char i=0; i<TEMP_COUNT; ++i)
{
for (unsigned char j=ALARM_IDX_LOW; j<=ALARM_IDX_HIGH; ++j)
{
boolean ringing = pid.Probes[i]->Alarms.Ringing[j];
unsigned char alarmId = MAKE_ALARM_ID(i, j);
if (ringing)
{
anyRinging = true;
g_AlarmId = alarmId;
}
ledmanager.publish(LEDSTIMULUS_Alarm0L + alarmId, ringing);
}
}
ledmanager.publish(LEDSTIMULUS_AlarmAny, anyRinging);
if (anyRinging)
{
reportAlarmLimits();
Menus.setState(ST_HOME_ALARM);
}
else if (Menus.getState() == ST_HOME_ALARM)
// No alarms ringing, return to HOME
Menus.setState(ST_HOME_FOOD1);
}
示例3: newTempsAvail
static void newTempsAvail(void)
{
static unsigned char pidCycleCount;
updateDisplay();
++pidCycleCount;
if ((pidCycleCount % 0x20) == 0)
outputRfStatus();
outputCsv();
// We want to report the status before the alarm readout so
// receivers can tell what the value was that caused the alarm
checkAlarms();
if (g_LogPidInternals)
pid.pidStatus();
ledmanager.publish(LEDSTIMULUS_Off, LEDACTION_Off);
ledmanager.publish(LEDSTIMULUS_LidOpen, pid.isLidOpen());
ledmanager.publish(LEDSTIMULUS_FanOn, pid.isOutputActive());
ledmanager.publish(LEDSTIMULUS_FanMax, pid.isOutputMaxed());
ledmanager.publish(LEDSTIMULUS_PitTempReached, pid.isPitTempReached());
#ifdef HEATERMETER_RFM12
rfmanager.sendUpdate(pid.getPidOutput());
#endif
}
示例4: storeLedConf
static void storeLedConf(unsigned char led, unsigned char ledConf)
{
ledmanager.setAssignment(led, ledConf);
unsigned char *ofs = (unsigned char *)offsetof(__eeprom_data, ledConf);
ofs += led;
econfig_write_byte(ofs, ledConf);
}
示例5: hmcoreLoop
void hmcoreLoop(void)
{
#ifdef HEATERMETER_SERIAL
serial_doWork();
#endif /* HEATERMETER_SERIAL */
#ifdef HEATERMETER_RFM12
if (rfmanager.doWork())
ledmanager.publish(LEDSTIMULUS_RfReceive, LEDACTION_OneShot);
#endif /* HEATERMETER_RFM12 */
Menus.doWork();
if (pid.doWork())
newTempsAvail();
tone_doWork();
ledmanager.doWork();
}
示例6: reportLcdParameters
void reportLcdParameters(void)
{
print_P(PSTR("HMLB" CSV_DELIMITER));
SerialX.print(g_LcdBacklight, DEC);
Serial_csv();
SerialX.print(g_HomeDisplayMode, DEC);
for (unsigned char i=0; i<LED_COUNT; ++i)
{
Serial_csv();
SerialX.print(ledmanager.getAssignment(i), DEC);
}
Serial_nl();
}
示例7: eepromLoadBaseConfig
static void eepromLoadBaseConfig(unsigned char forceDefault)
{
// The compiler likes to join eepromLoadBaseConfig and eepromLoadProbeConfig s
// this union saves stack space by reusing the same memory area for both structs
union {
struct __eeprom_data base;
struct __eeprom_probe probe;
} config;
econfig_read_block(&config.base, 0, sizeof(__eeprom_data));
forceDefault = forceDefault || config.base.magic != EEPROM_MAGIC;
if (forceDefault != 0)
{
memcpy_P(&config.base, &DEFAULT_CONFIG[forceDefault - 1], sizeof(__eeprom_data));
econfig_write_block(&config.base, 0, sizeof(__eeprom_data));
}
pid.setSetPoint(config.base.setPoint);
pid.LidOpenOffset = config.base.lidOpenOffset;
pid.setLidOpenDuration(config.base.lidOpenDuration);
memcpy(pid.Pid, config.base.pidConstants, sizeof(config.base.pidConstants));
if (config.base.manualMode)
pid.setPidOutput(0);
setLcdBacklight(config.base.lcdBacklight);
#ifdef HEATERMETER_RFM12
memcpy(rfMap, config.base.rfMap, sizeof(rfMap));
#endif
pid.setUnits(config.base.pidUnits == 'C' ? 'C' : 'F');
pid.setFanMinSpeed(config.base.fanMinSpeed);
pid.setFanMaxSpeed(config.base.fanMaxSpeed);
pid.setFanActiveFloor(config.base.fanActiveFloor);
pid.setFanMaxStartupSpeed(config.base.fanMaxStartupSpeed);
pid.setOutputFlags(config.base.pidOutputFlags);
g_HomeDisplayMode = config.base.homeDisplayMode;
pid.setServoMinPos(config.base.servoMinPos);
pid.setServoMaxPos(config.base.servoMaxPos);
pid.setServoActiveCeil(config.base.servoActiveCeil);
for (unsigned char led = 0; led<LED_COUNT; ++led)
ledmanager.setAssignment(led, config.base.ledConf[led]);
}