src/selftest/SelftestHelper.cpp
// simply check, no notion of test being ready
simply check, no notion of test being ready
simply check no notion of test being ready
bool SelftestHelper::validateFrame(PixelFrame& rframe, uint16_t idx) {
	LOGD(SELF_H, "Validating display frame %d", idx);
	if (idx > _expectedNumFrames - 1) {
		LOGD(SELF_H, "Index (%d) exceeds number of test frames (%d).",
			idx, _expectedNumFrames);
		return false;
	}
	if (idx<4) {
		rgbVal expectedColor = idx%2 == 0 ? 
			_red : _green;
		for (uint8_t i=0; i<N_PIXELS; i++) {
			if (idx%2 == 0){
				if (!_isRgbEqual(rframe.pixel[i], expectedColor)) {
				LOGD(SELF_H, "Wrong color (%d %d %d instead of %d %d %d) at display frame %d",
					rframe.pixel[i].r, rframe.pixel[i].g, rframe.pixel[i].b, 
					expectedColor.r, expectedColor.g, expectedColor.b, idx);
				return false;
				}
			}
		}
	}
	return true;
}
bool SelftestHelper :: validateFrame ( PixelFrame & rframe , uint16_t idx ) { LOGD ( SELF_H , " " , idx ) ; if ( idx > _expectedNumFrames - 1 ) { LOGD ( SELF_H , " " , idx , _expectedNumFrames ) ; return false ; } if ( idx < 4 ) { rgbVal expectedColor = idx % 2 == 0 ? _red : _green ; for ( uint8_t i = 0 ; i < N_PIXELS ; i ++ ) { if ( idx % 2 == 0 ) { if ( ! _isRgbEqual ( rframe . pixel [ i ] , expectedColor ) ) { LOGD ( SELF_H , " " , rframe . pixel [ i ] . r , rframe . pixel [ i ] . g , rframe . pixel [ i ] . b , expectedColor . r , expectedColor . g , expectedColor . b , idx ) ; return false ; } } } } return true ; }
simply check, no notion of test being ready
simply check no notion of test being ready
// 4 SHOW_RGB commands // image frames