📄 avrcam.lss
字号:
438: 4f ea ldi r20, 0xAF ; 175
43a: 4d 15 cp r20, r13
43c: 40 f6 brcc .-112 ; 0x3ce
}
UartInt_txByte(0x0F); /* send line end */
43e: 8f e0 ldi r24, 0x0F ; 15
440: 8f d3 rcall .+1822 ; 0xb60
/* once all the data is sent, increment out line count by 2 since
we really get 2 lines worth of pixels on each pass */
/* Update...increment only by 1, but only send 72 double-lines */
lineCount++;
442: 80 91 73 00 lds r24, 0x0073
446: 8f 5f subi r24, 0xFF ; 255
448: 80 93 73 00 sts 0x0073, r24
/* check to see if we have retrieved all of the needed lines */
if (lineCount >= 72) /* half 144, since we send two lines at a time */
44c: 88 34 cpi r24, 0x48 ; 72
44e: 08 f4 brcc .+2 ; 0x452
450: 4a c0 rjmp .+148 ; 0x4e6
{
/* we're done, so send the dump complete?...nope, just change
states and we should be fine */
lineCount = 0;
452: 10 92 73 00 sts 0x0073, r1
currentState = ST_FrameMgr_idle;
456: 10 92 74 00 sts 0x0074, r1
/* disable the PCLK counting overflow interrupt */
TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK;
45a: 89 b7 in r24, 0x39 ; 57
45c: 8b 7f andi r24, 0xFB ; 251
45e: 89 bf out 0x39, r24 ; 57
CamConfig_setCamReg(0x11,0x00); /* reset the frame rate to normal*/
460: 60 e0 ldi r22, 0x00 ; 0
462: 81 e1 ldi r24, 0x11 ; 17
464: 91 d4 rcall .+2338 ; 0xd88
CamConfig_sendFifoCmds();
466: 95 d4 rcall .+2346 ; 0xd92
468: 43 c0 rjmp .+134 ; 0x4f0
}
else
{
/* we have more lines to acquire in this frame, so keep on truckin...*/
PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE);
}
}
else if (currentState == ST_FrameMgr_TrackingFrame)
46a: 80 91 74 00 lds r24, 0x0074
46e: 81 30 cpi r24, 0x01 ; 1
470: 09 f0 breq .+2 ; 0x474
472: 3e c0 rjmp .+124 ; 0x4f0
{
#ifdef DEBUG_TRACKED_LINE
/* send the received line over serial...this should only send
until a pixelCount == 176 */
pSendData = currentLineBuffer;
itoa(trackedLineCount,asciiBuffer,10);
UIMgr_txBuffer(asciiBuffer,3);
UIMgr_txBuffer(" ",1);
while(pixelCount < ACTUAL_NUM_PIXELS_IN_A_LINE)
{
memset(asciiBuffer,0x00,5);
itoa(*pSendData++,asciiBuffer,10); /* color is first byte */
UIMgr_txBuffer(asciiBuffer,3); /* 3 ascii bytes for data */
UIMgr_txBuffer(" ",1);
pixelCount += *pSendData; /* run-length is second byte */
memset(asciiBuffer,0x00,5);
itoa(*pSendData++,asciiBuffer,10);
UIMgr_txBuffer(asciiBuffer,3);
UIMgr_txBuffer(" ",1);
}
UIMgr_txBuffer("\n\r",2);
trackedLineCount++;
if (trackedLineCount == 144)
{
UIMgr_txBuffer(" FC \n\r",8);
trackedLineCount = 0;
PUBLISH_EVENT(EV_PROCESS_FRAME_COMPLETE);
}
else
{
PUBLISH_EVENT(EV_PROCESS_LINE_COMPLETE);
}
#else
/* determine if any of the RLE blocks overlap */
FrameMgr_findConnectedness();
474: a1 d0 rcall .+322 ; 0x5b8
/* we also want to remove any objects that are less than
a minimum height...we already removed portions of the
run-length that are less than MIN_PIXEL_WIDTH in the
findConnectedness() routine...doing it here instead of
a function to speed things up...this may end up slowing down the
frame rate slightly, and can be removed if this isn't needed */
/* run this routine once every 8 lines */
if ( (trackedLineCount & RUN_OBJECT_FILTER_MASK) == RUN_OBJECT_FILTER_MASK)
476: 80 91 77 00 lds r24, 0x0077
47a: 99 27 eor r25, r25
47c: 87 70 andi r24, 0x07 ; 7
47e: 90 70 andi r25, 0x00 ; 0
480: 07 97 sbiw r24, 0x07 ; 7
482: 11 f5 brne .+68 ; 0x4c8
{
for (i=0; i<MAX_TRACKED_OBJECTS; i++)
484: dd 24 eor r13, r13
{
if ( *(pTrackedObjectData + VALID_OBJECT_OFFSET) == TRUE)
486: f8 01 movw r30, r16
488: 87 81 ldd r24, Z+7 ; 0x07
48a: 81 30 cpi r24, 0x01 ; 1
48c: b9 f4 brne .+46 ; 0x4bc
{
/* check to see if the object is already in
our past...i.e., its last */
if ( (*(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) -
48e: 86 81 ldd r24, Z+6 ; 0x06
490: 28 2f mov r18, r24
492: 33 27 eor r19, r19
494: 84 81 ldd r24, Z+4 ; 0x04
496: a9 01 movw r20, r18
498: 48 1b sub r20, r24
49a: 51 09 sbc r21, r1
49c: 43 30 cpi r20, 0x03 ; 3
49e: 51 05 cpc r21, r1
4a0: 6c f4 brge .+26 ; 0x4bc
*(pTrackedObjectData + Y_UPPER_LEFT_OFFSET)) < MIN_OBJECT_TRACKING_HEIGHT)
{
/* the object is less than the minimum height...see if it is adjacent
to the current line we just processed...if so, leave it here...otherwise,
it needs to be invalidated since its too small */
if ( trackedLineCount - *(pTrackedObjectData + Y_LOWER_RIGHT_OFFSET) > 2)
4a2: 80 91 77 00 lds r24, 0x0077
4a6: 99 27 eor r25, r25
4a8: 82 1b sub r24, r18
4aa: 93 0b sbc r25, r19
4ac: 03 97 sbiw r24, 0x03 ; 3
4ae: 34 f0 brlt .+12 ; 0x4bc
{
/* invalidate the object */
*(pTrackedObjectData + VALID_OBJECT_OFFSET) = FALSE;
4b0: 17 82 std Z+7, r1 ; 0x07
numCurrTrackedObjects--;
4b2: 80 91 75 00 lds r24, 0x0075
4b6: 81 50 subi r24, 0x01 ; 1
4b8: 80 93 75 00 sts 0x0075, r24
}
}
}
pTrackedObjectData += SIZE_OF_TRACKED_OBJECT;
4bc: 08 5f subi r16, 0xF8 ; 248
4be: 1f 4f sbci r17, 0xFF ; 255
4c0: d3 94 inc r13
4c2: 57 e0 ldi r21, 0x07 ; 7
4c4: 5d 15 cp r21, r13
4c6: f8 f6 brcc .-66 ; 0x486
}
}
trackedLineCount++;
4c8: 80 91 77 00 lds r24, 0x0077
4cc: 8f 5f subi r24, 0xFF ; 255
4ce: 80 93 77 00 sts 0x0077, r24
if (trackedLineCount == ACTUAL_NUM_LINES_IN_A_FRAME)
4d2: 80 39 cpi r24, 0x90 ; 144
4d4: 41 f4 brne .+16 ; 0x4e6
{
/* an entire frame of tracking data has been acquired, so
publish an event letting the system know this fact */
PUBLISH_EVENT(EV_ACQUIRE_FRAME_COMPLETE);
4d6: 80 e2 ldi r24, 0x20 ; 32
4d8: bc de rcall .-648 ; 0x252
/* disable the PCLK counting overflow interrupt */
TIMSK &= DISABLE_PCLK_TIMER1_OVERFLOW_BITMASK;
4da: 89 b7 in r24, 0x39 ; 57
4dc: 8b 7f andi r24, 0xFB ; 251
4de: 89 bf out 0x39, r24 ; 57
trackedLineCount = 0;
4e0: 10 92 77 00 sts 0x0077, r1
4e4: 05 c0 rjmp .+10 ; 0x4f0
}
else
{
PUBLISH_FAST_EVENT(FEV_PROCESS_LINE_COMPLETE);
4e6: 80 91 72 00 lds r24, 0x0072
4ea: 82 60 ori r24, 0x02 ; 2
4ec: 80 93 72 00 sts 0x0072, r24
}
#endif
}
else
{
/* ...and here? */
}
}
4f0: 21 96 adiw r28, 0x01 ; 1
4f2: 0f b6 in r0, 0x3f ; 63
4f4: f8 94 cli
4f6: de bf out 0x3e, r29 ; 62
4f8: 0f be out 0x3f, r0 ; 63
4fa: cd bf out 0x3d, r28 ; 61
4fc: df 91 pop r29
4fe: cf 91 pop r28
500: 1f 91 pop r17
502: 0f 91 pop r16
504: ff 90 pop r15
506: ef 90 pop r14
508: df 90 pop r13
50a: 08 95 ret
0000050c <FrameMgr_processFrame>:
/***********************************************************
Function Name: FrameMgr_processFrame
Function Description: This function is responsible for
parsing the completed frame and performing all actions
needed at this level.
Inputs: none
Outputs: none
***********************************************************/
void FrameMgr_processFrame(void)
{
50c: df 92 push r13
50e: ef 92 push r14
510: ff 92 push r15
512: 0f 93 push r16
514: 1f 93 push r17
516: cf 93 push r28
518: df 93 push r29
unsigned char i,k,color;
#if DEBUG_FRAME_DATA
unsigned char asciiBuffer[5];
unsigned char j;
#endif
unsigned char *pTableData = (unsigned char *)pCurrentTrackedObjectTable;
unsigned char tmpUpperLeftX,tmpUpperLeftY,tmpLowerRightX,tmpLowerRightY;
#if DEBUG_FRAME_DATA
/* we want to send all of the currently tracked table out
the serial port for debugging */
for (i=0; i<numCurrTrackedObjects; i++)
{
UIMgr_txBuffer("----------\r\n",12);
for (j=0; j<SIZE_OF_TRACKED_OBJECT; j++)
{
memset(asciiBuffer,0x00,5);
itoa(*pTableData++,asciiBuffer,10);
UIMgr_txBuffer(asciiBuffer,3); /* 3 ascii bytes for data
+ 1 space */
UIMgr_txBuffer("\r\n",2);
}
}
/* finally, send a new line */
UIMgr_txBuffer("\r\n",2);
memset(asciiBuffer,0x00,5);
itoa(numCurrTrackedObjects,asciiBuffer,10);
UIMgr_txBuffer(asciiBuffer,3);
UIMgr_txBuffer(" PFC\r\n",5);
#else
/* we only send tracking packets if there are tracked objects */
if (numCurrTrackedObjects > 0)
51a: 80 91 75 00 lds r24, 0x0075
51e: 88 23 and r24, r24
520: 09 f4 brne .+2 ; 0x524
522: 40 c0 rjmp .+128 ; 0x5a4
{
UIMgr_writeTxFifo(0x0A); /* header byte for a tracking packet */
524: 8a e0 ldi r24, 0x0A ; 10
526: 01 d3 rcall .+1538 ; 0xb2a
/* reset the pointer */
pTableData = (unsigned char *)pCurrentTrackedObjectTable;
528: c0 91 60 00 lds r28, 0x0060
52c: d0 91 61 00 lds r29, 0x0061
UIMgr_writeTxFifo(numCurrTrackedObjects); /* num of objects tracked */
530: 80 91 75 00 lds r24, 0x0075
534: fa d2 rcall .+1524 ; 0xb2a
for (i=0; i<MAX_TRACKED_OBJECTS; i++)
536: dd 24 eor r13, r13
{
/* we only want to process objects that have their objectValid flag
set to TRUE */
if ( *(pTableData + VALID_OBJECT_OFFSET) == TRUE)
538: 8f 81 ldd r24, Y+7 ; 0x07
53a: 81 30 cpi r24, 0x01 ; 1
53c: 61 f5 brne .+88 ; 0x596
{
/* the object is valid...convert the color from bit position to value...remember,
each bit in the "color" byte corresponds to a color */
k=0;
53e: 80 e0 ldi r24, 0x00 ; 0
color = *(pTableData + COLOR_OFFSET);
540: 98 81 ld r25, Y
if (color == 128) k=0;
542: 90 38 cpi r25, 0x80 ; 128
544: d9 f0 breq .+54 ; 0x57c
else if (color == 64) k=1;
546: 90 34 cpi r25, 0x40 ; 64
548: 11 f4 brne .+4 ; 0x54e
54a: 81 e0 ldi r24, 0x01 ; 1
54c: 17 c0 rjmp .+46 ; 0x57c
else if (color == 32) k=2;
54e: 90 32 cpi r25, 0x20 ; 32
550: 11 f4 brne .+4 ; 0x556
552: 82 e0 ldi r24, 0x02 ; 2
554: 13 c0 rjmp .+38 ; 0x57c
else if (color == 16) k=3;
556: 90 31 cpi r25, 0x10 ; 16
558: 11 f4 brne .+4 ; 0x55e
55a: 83 e0 ldi r24, 0x03 ; 3
55c: 0f c0 rjmp .+30 ; 0x57c
else if (color == 8) k=4;
55e: 98 30 cpi r25, 0x08 ; 8
560: 11 f4 brne .+4 ; 0x566
562: 84 e0 ldi r24, 0x04 ; 4
564: 0b c0 rjmp .+22 ; 0x57c
else if (color == 4) k=5;
566: 94 30 cpi r25, 0x04 ; 4
568: 11 f4 brne .+4 ; 0x56e
56a: 85 e0 ldi r24, 0x05 ; 5
56c: 07 c0 rjmp .+14 ; 0x57c
else if (color == 2) k=6;
56e: 92 30 cpi r25, 0x02 ; 2
570: 11 f4 brne .+4 ; 0x576
572: 86 e0 ldi r24, 0x06 ; 6
574: 03 c0 rjmp .+6 ; 0x57c
else if (color == 1) k=7;
576: 91 30 cpi r25, 0x01 ; 1
578: 09 f4 brne .+2 ; 0x57c
57a: 87 e0 ldi r24, 0x07 ; 7
tmpUpperLeftX = *(pTableData + X_UPPER_LEFT_OFFSET); /* get the upper left X */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -