Ejemplo n.º 1
0
void ProcessCmd()
{ 
    if ( (strcmp_P( command, PSTR("/id?")) == 0) && ( (arg_count == 0) || (arg_count == 1)) )
    {
        Id("Adc");
    }
    if ( (strcmp_P( command, PSTR("/analog?")) == 0) && ( (arg_count >= 1 ) && (arg_count <= 5) ) )
    {
        Analog(2000UL); // analog.c: show every 2 sec until terminated
    }
    if ( (strcmp_P( command, PSTR("/avcc")) == 0) && (arg_count == 1) )
    {
        CalibrateAVCC();
    }
    if ( (strcmp_P( command, PSTR("/onevone")) == 0) && (arg_count == 1) )
    {
        Calibrate1V1();
    }
    if ( (strcmp_P( command, PSTR("/reftoee")) == 0) && (arg_count == 0) )
    {
        Ref2Ee();
    }
    if ( (strcmp_P( command, PSTR("/reffrmee")) == 0) && (arg_count == 0) )
    {
        ReFmEe();
    }
}
Ejemplo n.º 2
0
void PerformanceStackPair::AddValue(uint32_t i, UpdateBuilder& builder)
{
    const uint16_t index = i % NUM_POINTS_PER_TYPE;

    switch (i % 7)
    {
    case (0):
        builder.Update(Binary(i % 2 == 0), index, EventMode::Force);
        break;
    case (1):
        builder.Update(DoubleBitBinary(i % 2 == 0 ? DoubleBit::DETERMINED_ON : DoubleBit::DETERMINED_OFF), index,
                       EventMode::Force);
        break;
    case (2):
        builder.Update(Analog(i), index, EventMode::Force);
        break;
    case (3):
        builder.Update(Counter(i), index, EventMode::Force);
        break;
    case (4):
        builder.Update(FrozenCounter(i), index, EventMode::Force);
        break;
    case (5):
        builder.Update(BinaryOutputStatus(i % 2 == 0), index, EventMode::Force);
        break;
    default:
        builder.Update(AnalogOutputStatus(i), index, EventMode::Force);
        break;
    }
}