Esempio n. 1
0
void setup() {
    for (uint8_t pin=bit0_pin; pin < bit15_pin; ++pin) {
        pinMode(pin, OUTPUT);
        digitalWrite(pin, HIGH);
    }
    delay(500);
    for (uint8_t pin=bit0_pin; pin < bit15_pin; ++pin) {
        digitalWrite(pin, LOW);
    }


    pinMode(dcf77_sample_pin, INPUT);
    digitalWrite(dcf77_sample_pin, HIGH);

    pinMode(filtered_dcf77_pin, OUTPUT);

    MsTimer2::set(1, low_pass_filter);
    MsTimer2::start();


    DCF.Start();
    setSyncInterval(30);
    setSyncProvider(getDCFTime);


    Serial.begin(9600);;
    diagnosis();
}
Esempio n. 2
0
bool MvcController::Validate()
{
    std::string const name = NameOfControlToDeferEvaluating();
    if(name.empty())
        {
        return true;
        }

    UpdateWindowUI();
    tn_range_base const& datum = ModelReference<tn_range_base>(name);
    std::string const& view_value = map_lookup(transfer_data_, name);
    std::string diagnosis(datum.diagnose_invalidity(view_value));
    DiagnosticsWindow().SetLabel(diagnosis);
    if(diagnosis.empty())
        {
        model_.Entity(name) = view_value;
        Assimilate("");
        }
    return diagnosis.empty();
}
Esempio n. 3
0
static int restore(T *thiz)
{
    int r;
    hdr_block_t hdr;

    INFO("restoring %s", thiz->file);

    r = prepare_file(thiz);
    if (r != 0) return -1;

    r = diagnosis(thiz);
    if (r != 0) return -1;

    r = read_hdr(thiz, &hdr);
    if (r != 0) return -1;

    r = fit_file(thiz, &hdr);
    if (r != 0) return -1;

    r = update_hdr(thiz, &hdr);
    if (r != 0) return -1;

    return 0;
}