DMA 인터럽트 처리기에 문제가 있습니다. MicroChip PIC32 임베디드 칩의 LCD 디스플레이에 맞게 조정했습니다.for 루프의 바이트에서 니블 추출하기
저는 내부 메모리가 제한되어 있으며 내 컬러 LCD 용 프레임 버퍼가 필요합니다. 16 색을 사용하고 픽셀 당 니블을 사용하기로 결정했습니다. 내가 병렬 포트 및 DMA 전송을 통해 LCD에 보낼 16 비트 값으로 4 비트 니블 변환하고 내 인터럽트 핸들러에서
unsigned char GraphicsFrame[FRAME_HEIGHT][LINE_LENGTH/2];
:이처럼 보이는 배열을 만들었습니다. 내가 이것을 달성하기 위해 인터럽트 처리기에서 테이블을 사용하지만,이 때 나는 General_Exception_Handler로 갈거야 디버깅하고 내가 4 비트 니블을 추출하고 16 비트 값으로 변환하는 방식으로 문제를 지적하고있어 :
for(i=0,j=0; i<30; i++, lineX++)
{
// not particularly elegant, perhaps look at a better way
if ((((GraphicsFrame[line][i]) >> 4) & 0x0F) == 0x0) lineBuffer[j++] = (unsigned short int)RGBBlack;
else if((((GraphicsFrame[line][i]) >> 4) & 0x0F) == 0x1) lineBuffer[j++] = (unsigned short int)RGBBlue;
else if((((GraphicsFrame[line][i]) >> 4) & 0x0F) == 0x2) lineBuffer[j++] = (unsigned short int)RGBRed;
else if((((GraphicsFrame[line][i]) >> 4) & 0x0F) == 0x3) lineBuffer[j++] = (unsigned short int)RGBGreen;
else if((((GraphicsFrame[line][i]) >> 4) & 0x0F) == 0x4) lineBuffer[j++] = (unsigned short int)RGBCyan;
else if((((GraphicsFrame[line][i]) >> 4) & 0x0F) == 0x6) lineBuffer[j++] = (unsigned short int)RGBYellow;
else if((((GraphicsFrame[line][i]) >> 4) & 0x0F) == 0x7) lineBuffer[j++] = (unsigned short int)RGBKaneGreen;
else if((((GraphicsFrame[line][i]) >> 4) & 0x0F) == 0xF) lineBuffer[j++] = (unsigned short int)RGBWhite;
if ((GraphicsFrame[line][i] & 0x0F) == 0x0) lineBuffer[j++] = (unsigned short int)RGBBlack;
else if((GraphicsFrame[line][i] & 0x0F) == 0x1) lineBuffer[j++] = (unsigned short int)RGBBlue;
else if((GraphicsFrame[line][i] & 0x0F) == 0x2) lineBuffer[j++] = (unsigned short int)RGBRed;
else if((GraphicsFrame[line][i] & 0x0F) == 0x3) lineBuffer[j++] = (unsigned short int)RGBGreen;
else if((GraphicsFrame[line][i] & 0x0F) == 0x4) lineBuffer[j++] = (unsigned short int)RGBCyan;
else if((GraphicsFrame[line][i] & 0x0F) == 0x5) lineBuffer[j++] = (unsigned short int)RGBMagenta;
else if((GraphicsFrame[line][i] & 0x0F) == 0x6) lineBuffer[j++] = (unsigned short int)RGBYellow;
else if((GraphicsFrame[line][i] & 0x0F) == 0x7) lineBuffer[j++] = (unsigned short int)RGBKaneGreen;
else if((GraphicsFrame[line][i] & 0x0F) == 0xF) lineBuffer[j++] = (unsigned short int)RGBWhite;
}
나는 60 개 픽셀이 들어있는 다른 배열을 사용하여 한 번 (60 × 16 비트)에서 60 개 픽셀을 전송하는 DMA를 설정하기 위해 노력하고있어 :
이unsigned short int lineBuffer[60];
사람은 자리 수를 니블을 추출하고 변환하는 방식에 문제가 있습니까? 아무런 경고 나 오류도 없으므로 아무 것도 나에게 뛰어 오지 않습니다! 그것은 지금까지 내가 당신이 무엇을 게시에서 말할 수 괜찮아 보이는
감사의 말을 많이 전합니다. 네, 실제로 look up table을 구현하지 않았습니다! 약간 '진행중인 작업'이었지만 여러분의 솔루션이 마음에 들었고 대부분 구현했습니다. 나는 여전히 문제를 겪고 있으므로 ISR의 어딘가에서 벗어날 것이라고 생각합니다. –