Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void processFrame() {
- startNewFrame(uartPixelFormat);
- camera.waitForVsync();
- for (uint16_t y = 0; y < lineCount; y++) {
- lineBufferIndex = 0;
- uint8_t sendWhileReadCounter = 0;
- lineBuffer[0] = 0; // first byte from Camera is half a pixel
- for (uint16_t x = 1; x < lineLength * 2 + 1; x++) {
- // start sending first bytes while reading pixels from camera
- if (uartSendWhileReadingCount > 0) {
- if (sendWhileReadCounter) {
- sendWhileReadCounter--;
- } else {
- sendNextPixelByte();
- sendWhileReadCounter = uartSendWhileReadingCount;
- }
- }
- camera.waitForPixelClockRisingEdge();
- camera.readPixelByte(lineBuffer[x]);
- }
- while (lineBufferIndex < lineLength * 2) {
- sendNextPixelByte();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement