示例#1
0
void TMdPrm::vlGet( TVal &vo )
{
    if(!enableStat() || !owner().startStat()) {
	if(vo.name() == "err") {
	    if(!enableStat())			vo.setS(_("1:Parameter is disabled."),0,true);
	    else if(!owner().startStat())	vo.setS(_("2:Acquisition/access is stopped."),0,true);
	}
	else vo.setR(EVAL_REAL, 0, true);
	return;
    }

    if(vo.name() == "err") vo.setS("0", 0, true);
    else if(vo.name().compare(0,4,"gpio") == 0)
	vo.setB(bool(bcm2835_gpio_lev(s2i(vo.name().substr(4))))^bool(s2i(vo.fld().reserve())), 0, true);
}
示例#2
0
void SUNXI::vlGet( TParamContr *ip, TVal &vo )
{
    if(vo.name().compare(0,4,"gpio") == 0)
	vo.setB(bool(sunxi_gpio_input(s2i(vo.name().substr(4))))^bool(s2i(vo.fld().reserve())), 0, true);
}