コード例 #1
0
ファイル: scope.cpp プロジェクト: larbiaissat/simulavr
void Scope::SetInStateForChannel(unsigned int channel, Pin& p) {
    if ( lastVal[channel]!= p.GetAnalog() ) {
        ostringstream os;
        os << name << " ChangeValue " << SystemClock::Instance().GetCurrentTime() << " " << channel << " " << p.GetAnalog()<<endl;

        ui->Write(os.str());
        //cout << "Set last val for channel " << channel << " value " << p.GetAnalog() << endl;
        lastVal[channel]=p.GetAnalog();
        //cout << "OK" << endl << endl;
    }
}
コード例 #2
0
ファイル: hwad.cpp プロジェクト: ndim/simulavr
int HWAdmux::GetMuxOutput() {

    int   pin = admux&(MUX2|MUX1|MUX0);
    Pin*  p = ad[pin];
    if(!p){
	cerr << "HWAdmux::GetMuxOutput null pin on " << pin << endl;
        return 0;
    }
    return p->GetAnalog();
}