📄 avrcam.lss
字号:
break;
case EV_DISABLE_TRACKING:
/* tracking needs to be turned off */
currentState = ST_FrameMgr_idle;
break;
}
}
29a: 08 95 ret
29c: 80 38 cpi r24, 0x80 ; 128
29e: 91 05 cpc r25, r1
2a0: c1 f0 breq .+48 ; 0x2d2
2a2: 81 38 cpi r24, 0x81 ; 129
2a4: 91 05 cpc r25, r1
2a6: 1c f4 brge .+6 ; 0x2ae
2a8: 80 97 sbiw r24, 0x20 ; 32
2aa: b9 f0 breq .+46 ; 0x2da
2ac: 08 95 ret
2ae: 81 38 cpi r24, 0x81 ; 129
2b0: 91 05 cpc r25, r1
2b2: f1 f0 breq .+60 ; 0x2f0
2b4: 08 95 ret
2b6: 61 e0 ldi r22, 0x01 ; 1
2b8: 81 e1 ldi r24, 0x11 ; 17
2ba: 66 d5 rcall .+2764 ; 0xd88
2bc: 6a d5 rcall .+2772 ; 0xd92
2be: 88 ee ldi r24, 0xE8 ; 232
2c0: 93 e0 ldi r25, 0x03 ; 3
2c2: c1 d5 rcall .+2946 ; 0xe46
2c4: 10 92 73 00 sts 0x0073, r1
2c8: 82 e0 ldi r24, 0x02 ; 2
2ca: 80 93 74 00 sts 0x0074, r24
2ce: 2f d0 rcall .+94 ; 0x32e
2d0: 08 95 ret
2d2: 81 e0 ldi r24, 0x01 ; 1
2d4: 80 93 74 00 sts 0x0074, r24
2d8: 02 c0 rjmp .+4 ; 0x2de
2da: 18 d1 rcall .+560 ; 0x50c
2dc: 08 95 ret
2de: 0c d0 rcall .+24 ; 0x2f8
2e0: 08 95 ret
2e2: 80 91 74 00 lds r24, 0x0074
2e6: 88 23 and r24, r24
2e8: 29 f0 breq .+10 ; 0x2f4
2ea: 84 e0 ldi r24, 0x04 ; 4
2ec: b2 df rcall .-156 ; 0x252
2ee: 08 95 ret
2f0: 10 92 74 00 sts 0x0074, r1
2f4: 08 95 ret
2f6: 08 95 ret
000002f8 <FrameMgr_acquireFrame>:
/***********************************************************
Function Name: FrameMgr_acquireFrame
Function Description: This function is responsible for
beginning of the acquisition of a new frame of data
from the camera interface. The acquisition of this line
depends on the current state of the FrameMgr.
Inputs: none
Outputs: none
***********************************************************/
void FrameMgr_acquireFrame(void)
{
if (currentState == ST_FrameMgr_TrackingFrame)
2f8: 80 91 74 00 lds r24, 0x0074
2fc: 81 30 cpi r24, 0x01 ; 1
2fe: a9 f4 brne .+42 ; 0x32a
{
trackedLineCount = 0;
300: 10 92 77 00 sts 0x0077, r1
numPrevTrackedObjects = numCurrTrackedObjects;
304: 80 91 75 00 lds r24, 0x0075
308: 80 93 76 00 sts 0x0076, r24
numCurrTrackedObjects = 0;
30c: 10 92 75 00 sts 0x0075, r1
/* clear out the tracking table, and wait for the new frame
to start */
memset(trackedObjectTable,0x00,sizeof(trackedObjectTable));
310: 80 e4 ldi r24, 0x40 ; 64
312: e8 e7 ldi r30, 0x78 ; 120
314: f0 e0 ldi r31, 0x00 ; 0
316: 11 92 st Z+, r1
318: 8a 95 dec r24
31a: e9 f7 brne .-6 ; 0x316
//CamIntAsm_waitForNewTrackingFrame(currentLineBuffer,colorMap);
WAIT_FOR_VSYNC_HIGH();
31c: 82 9b sbis 0x10, 2 ; 16
31e: fe cf rjmp .-4 ; 0x31c
CamIntAsm_acquireTrackingLine(currentLineBuffer,colorMap);
320: 60 e0 ldi r22, 0x00 ; 0
322: 73 e0 ldi r23, 0x03 ; 3
324: 8c eb ldi r24, 0xBC ; 188
326: 91 e0 ldi r25, 0x01 ; 1
328: f0 d5 rcall .+3040 ; 0xf0a
}
}
32a: 08 95 ret
32c: 08 95 ret
0000032e <FrameMgr_acquireLine>:
/***********************************************************
Function Name: FrameMgr_acquireLine
Function Description: This function is responsible for
acquiring a line of data from the camera interface.
The acquisition of this line depends on the current
state of the FrameMgr.
Inputs: none
Outputs: none
***********************************************************/
void FrameMgr_acquireLine(void)
{
unsigned char tmpLineCount;
/* clearing out the buffers takes too long...we should
just overwrite the data here without a problem when
we start acquiring...at no point do we check for
a 0x00 value in the current or previous lineBuffers,
so it was a bit excessive :-) */
/* check which state we are in and proceed as needed */
if (currentState == ST_FrameMgr_DumpingFrame)
32e: 80 91 74 00 lds r24, 0x0074
332: 82 30 cpi r24, 0x02 ; 2
334: 11 f5 brne .+68 ; 0x37a
{
tmpLineCount = lineCount*2;
336: 80 91 73 00 lds r24, 0x0073
33a: 88 0f add r24, r24
/* clearing out the line data in dump mode is ok, and actually
is needed, since it is possible for the first dump line in
a frame to come back with the last line captured of the
last capture session...*/
memset(currentLineBuffer,0x00,LENGTH_OF_LINE_BUFFER);
33c: 90 eb ldi r25, 0xB0 ; 176
33e: ec eb ldi r30, 0xBC ; 188
340: f1 e0 ldi r31, 0x01 ; 1
342: 11 92 st Z+, r1
344: 9a 95 dec r25
346: e9 f7 brne .-6 ; 0x342
memset(previousLineBuffer,0x00,LENGTH_OF_LINE_BUFFER);
348: 90 eb ldi r25, 0xB0 ; 176
34a: ec e0 ldi r30, 0x0C ; 12
34c: f1 e0 ldi r31, 0x01 ; 1
34e: 11 92 st Z+, r1
350: 9a 95 dec r25
352: e9 f7 brne .-6 ; 0x34e
/* wait for another VSYNC so we know which frame to use
to start looking for a line to receive */
WAIT_FOR_VSYNC_HIGH();
354: 82 9b sbis 0x10, 2 ; 16
356: fe cf rjmp .-4 ; 0x354
WAIT_FOR_VSYNC_LOW();
358: 82 99 sbic 0x10, 2 ; 16
35a: fe cf rjmp .-4 ; 0x358
/* look at lineCount to determine how many HREFs we should
wait before we start sampling */
while(tmpLineCount != 0)
35c: 88 23 and r24, r24
35e: 39 f0 breq .+14 ; 0x36e
{
WAIT_FOR_HREF_HIGH();
360: 84 9b sbis 0x10, 4 ; 16
362: fe cf rjmp .-4 ; 0x360
tmpLineCount--;
364: 81 50 subi r24, 0x01 ; 1
WAIT_FOR_HREF_LOW();
366: 84 99 sbic 0x10, 4 ; 16
368: fe cf rjmp .-4 ; 0x366
36a: 88 23 and r24, r24
36c: c9 f7 brne .-14 ; 0x360
}
/* we should now be ready to sample our line...*/
CamIntAsm_acquireDumpLine(currentLineBuffer,previousLineBuffer);
36e: 6c e0 ldi r22, 0x0C ; 12
370: 71 e0 ldi r23, 0x01 ; 1
372: 8c eb ldi r24, 0xBC ; 188
374: 91 e0 ldi r25, 0x01 ; 1
376: 10 d6 rcall .+3104 ; 0xf98
}
else if (currentState == ST_FrameMgr_TrackingFrame)
{
WAIT_FOR_HREF_LOW();
CamIntAsm_acquireTrackingLine(currentLineBuffer,colorMap);
}
}
378: 08 95 ret
37a: 80 91 74 00 lds r24, 0x0074
37e: 81 30 cpi r24, 0x01 ; 1
380: 39 f4 brne .+14 ; 0x390
382: 84 99 sbic 0x10, 4 ; 16
384: fe cf rjmp .-4 ; 0x382
386: 60 e0 ldi r22, 0x00 ; 0
388: 73 e0 ldi r23, 0x03 ; 3
38a: 8c eb ldi r24, 0xBC ; 188
38c: 91 e0 ldi r25, 0x01 ; 1
38e: bd d5 rcall .+2938 ; 0xf0a
390: 08 95 ret
00000392 <FrameMgr_processLine>:
/***********************************************************
Function Name: FrameMgr_processLine
Function Description: This function is responsible for
parsing the received image line and performing either
connected region mapping (if in the Tracking state) or
sending out the raw sampled data (if in the Dumping
state).
Inputs: none
Outputs: none
***********************************************************/
void FrameMgr_processLine(void)
{
392: df 92 push r13
394: ef 92 push r14
396: ff 92 push r15
398: 0f 93 push r16
39a: 1f 93 push r17
39c: cf 93 push r28
39e: df 93 push r29
3a0: cd b7 in r28, 0x3d ; 61
3a2: de b7 in r29, 0x3e ; 62
3a4: 21 97 sbiw r28, 0x01 ; 1
3a6: 0f b6 in r0, 0x3f ; 63
3a8: f8 94 cli
3aa: de bf out 0x3e, r29 ; 62
3ac: 0f be out 0x3f, r0 ; 63
3ae: cd bf out 0x3d, r28 ; 61
unsigned char i;
volatile unsigned char dataToSend;
unsigned char *pTrackedObjectData = (unsigned char *)pCurrentTrackedObjectTable;
3b0: 00 91 60 00 lds r16, 0x0060
3b4: 10 91 61 00 lds r17, 0x0061
#ifdef DEBUG_TRACKED_LINE
unsigned char *pSendData;
unsigned char asciiBuffer[5];
unsigned char pixelCount = 0;
#endif
if (currentState == ST_FrameMgr_DumpingFrame)
3b8: 80 91 74 00 lds r24, 0x0074
3bc: 82 30 cpi r24, 0x02 ; 2
3be: 09 f0 breq .+2 ; 0x3c2
3c0: 54 c0 rjmp .+168 ; 0x46a
{
/* we want to sit in a tight loop and send the acquired data
sitting in current and previous line buffers out the serial
port...it is sent out the serial port immediately instead
of going into the UIMgr tx fifo because we can't do anything
until its sent out anyway...may as well just get it out now */
/* currentLineBuffer is getting "g" previousLineBuffer is getting "b-r" */
UartInt_txByte(0x0B); /* send the header byte */
3c2: 8b e0 ldi r24, 0x0B ; 11
3c4: cd d3 rcall .+1946 ; 0xb60
UartInt_txByte(lineCount); /* send the line count */
3c6: 80 91 73 00 lds r24, 0x0073
3ca: ca d3 rcall .+1940 ; 0xb60
for (i=0; i<NUM_PIXELS_IN_A_DUMP_LINE; i+=2)
3cc: dd 24 eor r13, r13
{
/* when a dump line is sampled, the upper byte can potentially
have garbage in it...we don't have time to mask it off as we're
sampling, so it is done here before we send it out...we also
combine the samples together so we really are sending up a
sample for line N as well as line N+1 */
dataToSend = currentLineBuffer[i];
3ce: 2d 2d mov r18, r13
3d0: 33 27 eor r19, r19
3d2: 0f 2e mov r0, r31
3d4: fc eb ldi r31, 0xBC ; 188
3d6: ef 2e mov r14, r31
3d8: f1 e0 ldi r31, 0x01 ; 1
3da: ff 2e mov r15, r31
3dc: f0 2d mov r31, r0
3de: e2 0e add r14, r18
3e0: f3 1e adc r15, r19
3e2: f7 01 movw r30, r14
3e4: 80 81 ld r24, Z
3e6: 89 83 std Y+1, r24 ; 0x01
dataToSend &= 0x0F;
3e8: 89 81 ldd r24, Y+1 ; 0x01
3ea: 8f 70 andi r24, 0x0F ; 15
3ec: 89 83 std Y+1, r24 ; 0x01
dataToSend <<= 4;
3ee: 89 81 ldd r24, Y+1 ; 0x01
3f0: 82 95 swap r24
3f2: 80 7f andi r24, 0xF0 ; 240
3f4: 89 83 std Y+1, r24 ; 0x01
dataToSend |= (previousLineBuffer[i] & 0x0F);
3f6: 89 01 movw r16, r18
3f8: 04 5f subi r16, 0xF4 ; 244
3fa: 1e 4f sbci r17, 0xFE ; 254
3fc: f8 01 movw r30, r16
3fe: 80 81 ld r24, Z
400: 98 2f mov r25, r24
402: 9f 70 andi r25, 0x0F ; 15
404: 89 81 ldd r24, Y+1 ; 0x01
406: 89 2b or r24, r25
408: 89 83 std Y+1, r24 ; 0x01
/* dataToSend should be packed now */
UartInt_txByte(dataToSend);
40a: 89 81 ldd r24, Y+1 ; 0x01
40c: a9 d3 rcall .+1874 ; 0xb60
/* flip the colors around since we are doing all G on Y and BR on UV */
dataToSend = previousLineBuffer[i+1];
40e: f8 01 movw r30, r16
410: 81 81 ldd r24, Z+1 ; 0x01
412: 89 83 std Y+1, r24 ; 0x01
dataToSend &= 0x0F;
414: 89 81 ldd r24, Y+1 ; 0x01
416: 8f 70 andi r24, 0x0F ; 15
418: 89 83 std Y+1, r24 ; 0x01
dataToSend <<= 4;
41a: 89 81 ldd r24, Y+1 ; 0x01
41c: 82 95 swap r24
41e: 80 7f andi r24, 0xF0 ; 240
420: 89 83 std Y+1, r24 ; 0x01
dataToSend |= (currentLineBuffer[i+1] & 0x0F);
422: f7 01 movw r30, r14
424: 81 81 ldd r24, Z+1 ; 0x01
426: 98 2f mov r25, r24
428: 9f 70 andi r25, 0x0F ; 15
42a: 89 81 ldd r24, Y+1 ; 0x01
42c: 89 2b or r24, r25
42e: 89 83 std Y+1, r24 ; 0x01
/* dataToSend should be packed now */
UartInt_txByte(dataToSend);
430: 89 81 ldd r24, Y+1 ; 0x01
432: 96 d3 rcall .+1836 ; 0xb60
434: f2 e0 ldi r31, 0x02 ; 2
436: df 0e add r13, r31
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -