/******************************************************************************* Display_Frame: 画参数栏框架。 *******************************************************************************/ void Display_Frame(void) { unsigned short i,j; for(i=0; i<320; ++i) { //画上背景框 __Point_SCR(i,0); for(j=0; j<MIN_Y-1; ++j) __Set_Pixel(LN2_COLOR); } for(i=0; i<320; ++i) { //画下背景框 __Point_SCR(i,MAX_Y+3); for(j=MAX_Y+3; j<240; ++j) __Set_Pixel(LN2_COLOR); } }
/******************************************************************************* Display_Logo: 在指定位置显示商标图案 输入: X、Y坐标 *******************************************************************************/ void Display_Logo(short x0, short y0) { short i, j, k, Color; char b; LCD_SET_WINDOW(x0,LCD_X2,y0,y0+63); for (i=0; i<68;++i) { for (j=7; j>=0; --j) { b=Logo_Dot_1[(i*8)+j]; for (k=0;k<8;++k){ if(b&1) Color=RED; else Color=BLACK; __Set_Pixel(Color); b >>=1; } } } // LCD_SET_WINDOW(x0+58,LCD_X2,y0,y0+63); for (i=0; i<192;++i) { for (j=7; j>=0; --j) { b=Logo_Dot_2[(i*8)+j]; for (k=0;k<8;++k){ if(b&1) Color=WHITE; else Color=BLACK; __Add_Pixel(x0+57+i, y0-1+k+(7-j)*8, Color); b >>=1; } } } LCD_SET_WINDOW(LCD_X1,LCD_X2,LCD_Y1,LCD_Y1); for(i=LCD_X1; i<LCD_X2+1; ++i) __Set_Pixel(0xFFFF); LCD_SET_WINDOW(LCD_X1+3,LCD_X2-3,LCD_Y1+3,LCD_Y1+3); for(i=LCD_X1; i<LCD_X2-2; ++i) __Set_Pixel(0xFFFF); LCD_SET_WINDOW(LCD_X1,LCD_X2,LCD_Y2,LCD_Y2); for(i=LCD_X1; i<LCD_X2+1; ++i) __Set_Pixel(0xFFFF); LCD_SET_WINDOW(LCD_X1+3,LCD_X2-3,LCD_Y2-3,LCD_Y2-3); for(i=0; i<320; ++i) __Set_Pixel(0xFFFF); LCD_SET_WINDOW(LCD_X1,LCD_X2,LCD_Y1,LCD_Y2); //恢复全尺寸窗口 __Point_SCR(LCD_X1, LCD_Y1); for(j=0; j<LCD_Y2+1; ++j) __Set_Pixel(0xFFFF); __Point_SCR(LCD_X1+3, LCD_Y1+3); for(j=3; j<LCD_Y2-2; ++j) __Set_Pixel(0xFFFF); __Point_SCR(LCD_X2-3, LCD_Y1+3); for(j=3; j<LCD_Y2-2; ++j) __Set_Pixel(0xFFFF); __Point_SCR(LCD_X2, LCD_Y1); for(j=0; j<LCD_Y2+1; ++j) __Set_Pixel(0xFFFF); }
static cell AMX_NATIVE_CALL amx_putpixel(AMX *amx, const cell *params) { // putpixel(x, y, color); __Point_SCR(params[1], params[2]); __LCD_SetPixl(params[3]); return 0; }
/******************************************************************************* Display_Grid: 画屏幕背景及坐标网格。 *******************************************************************************/ void Display_Grid(void) { unsigned short i,j; for(j=MIN_Y; j<=MAX_Y; j+=25){ // LCD_SET_WINDOW(MIN_X,MAX_X,j,j); // for(i=MIN_X; i<MAX_X+1; i++) __Set_Pixel(GRD_COLOR); //画水平格线 for(i=MIN_X; i<MAX_X+1; i+=5){ __Point_SCR(i,j); __Set_Pixel(GRD_COLOR); //画水平格线 } } /* LCD_SET_WINDOW(LCD_X1,LCD_X2,LCD_Y1,LCD_Y2); //恢复全尺寸窗口 for(i=MIN_X+5; i<MAX_X; i+=5){ __Point_SCR(i,MIN_Y+1); __Set_Pixel(GRD_COLOR); __Point_SCR(i,MAX_Y-1); __Set_Pixel(GRD_COLOR); __Point_SCR(i,((MIN_Y+MAX_Y)/2+1)); __Set_Pixel(GRD_COLOR); __Point_SCR(i,((MIN_Y+MAX_Y)/2-1)); __Set_Pixel(GRD_COLOR); //画水平分度线 } for(j=MIN_Y+5; j<MAX_Y; j+=5){ __Point_SCR(MIN_X+1,j); __Set_Pixel(GRD_COLOR); __Point_SCR(MAX_X-1,j); __Set_Pixel(GRD_COLOR); __Point_SCR(((MIN_X+MAX_X)/2+1),j); __Set_Pixel(GRD_COLOR); __Point_SCR(((MIN_X+MAX_X)/2-1),j); __Set_Pixel(GRD_COLOR); //画垂直分度线 } */ for(i=MIN_X;i<=MAX_X; i+=25){ // __Point_SCR(i,MIN_Y); // for(j=MIN_Y; j<=MAX_Y; j++) __Set_Pixel(GRD_COLOR); //画垂直格线 for(j=MIN_Y; j<=MAX_Y; j+=5){ __Point_SCR(i,j); __Set_Pixel(GRD_COLOR); //画垂直格线 } } }
int main(void) { NVIC_SetVectorTable(NVIC_VectTab_FLASH, (u32)&_vectors); __USB_Init(); //__Clear_Screen(0x0000); // display 400x240 for (int x=0; x<400; x++) for (int y=0; y<240-16; y++) { u32 dx = (x-200); u32 dy = (y-120); dx *= dx; dy *= dy; u32 dl = dx+dy; __Point_SCR(x, y); __LCD_SetPixl((uc16)(dl>>3) & 0x001f); } __Display_Str(20, 200, 0xffff, 0, "Hello DS203 Test... "); int x[3] = {20, 380, 220}; int y[3] = {20, 40, 220}; int curx = x[0]; int cury = y[0]; while ( !(GetKeys() & KEY2_STATUS) ) { int c = PRNG(); int r = c%3; curx = (curx+x[r]) >> 1; cury = (cury+y[r]) >> 1; __Point_SCR(curx, cury); __LCD_SetPixl(c<<1); // len do 32k } Reboot(); return 0; }
static void put_textcol(int x, int y, int column, int fg, int bg) { __Point_SCR(x, y); for (int i = 0; i < FONT_HEIGHT; i++) { if (column & 4) { __LCD_SetPixl(fg); } else if (bg >= 0) { __LCD_SetPixl(bg); } else { // Transparent background, skip pixel __Point_SCR(x, y + i + 1); } column >>= 1; } }
static cell AMX_NATIVE_CALL amx_getcolumn(AMX *amx, const cell *params) { // getcolumn(x, y, pixels[], count); int x = params[1]; int y = params[2]; cell *pixels = (cell*)params[3]; int count = params[4]; // Seems like DSO Quad may use two different kinds of LCD's, with // slightly different command sets.. if (LCD_RD_Type() == LCD_TYPE_ILI9327) { __Point_SCR(x, y); LCD_WR_Ctrl(0x2E); // Dummy read always_read(LCD_PORT); // Use DMA to do the transfer DMA2_Channel1->CCR = 0x5980; DMA2_Channel1->CMAR = (uint32_t)pixels; DMA2_Channel1->CNDTR = count; DMA2_Channel1->CCR = 0x5981; __LCD_DMA_Ready(); LCD_WR_Ctrl(0x2C); } else { // I haven't been able to test this code path. __LCD_DMA_Ready(); // The R61509V doesn't automatically increment the address // when reading, which slows this down a bit... LCD_WR_REG(0x0201, x); while (count--) { LCD_WR_REG(0x0200, y++); LCD_WR_Ctrl(0x0202); always_read(LCD_PORT); *pixels++ = LCD_PORT; } } return 0; }
static cell AMX_NATIVE_CALL amx_putcolumn(AMX *amx, const cell *params) { // putcolumn(x, y, const pixels[], count, wait); __Point_SCR(params[1], params[2]); cell *pixels = (cell*)params[3]; int count = params[4]; // Routine copied from SYS1.50 source and modified to do // 32 -> 16 bit mapping on the fly. DMA2_Channel1->CCR = 0x5990; DMA2_Channel1->CMAR = (uint32_t)pixels; DMA2_Channel1->CNDTR = count; DMA2_Channel1->CCR = 0x5991; if (params[5]) { __LCD_DMA_Ready(); } return 0; }
/******************************************************************************* Calibrat : Calibrat routine *******************************************************************************/ void Calibrat(u8 Channel) { s8 Ma1[10], Mb1[10], Ma3[10], Mb3[10]; u16 Ma2[10], Mb2[10], i, j; s16 TmpA, TmpB; u8 Range, n[10], k, m, Step; Key_Buffer = 0; __Set(STANDBY, DN); // 退出省电状态 __Set(BACKLIGHT, 10*(Title[BK_LIGHT][CLASS].Value+1)); __Clear_Screen(BLACK); // 清屏幕 Interlace = 0; __Set(ADC_MODE, SEPARATE); // Set Separate mode __Set(ADC_CTRL, EN); __Set(TRIGG_MODE, UNCONDITION); // 设任意触发 _Status = RUN; __Set(BEEP_VOLUME, 5*(Title[VOLUME][CLASS].Value-1)); // Reload volume Beep_mS = 500; // 蜂鸣器响500mS Range = 0; Step = 0; m = 0; __Set(T_BASE_PSC, X_Attr[_100uS].PSC); // T_BASE = 100uS __Set(T_BASE_ARR, X_Attr[_100uS].ARR); __Set(CH_A_COUPLE, DC); __Set(CH_B_COUPLE, DC); for(j=0; j<220; j+=20){ // 画表格 for(i=0; i<399; i++){ __Point_SCR(i, j); __LCD_SetPixl(WHT); } } for(i=0; i<399; i++){ __Point_SCR(i, 239); __LCD_SetPixl(WHT); } __Point_SCR( 0, 0); for(j= 0; j<239; j++) __LCD_SetPixl(WHT); __Point_SCR( 44, 20); for(j=20; j<201; j++) __LCD_SetPixl(WHT); __Point_SCR( 88, 20); for(j=20; j<201; j++) __LCD_SetPixl(WHT); __Point_SCR(132, 20); for(j=20; j<201; j++) __LCD_SetPixl(WHT); __Point_SCR(200, 20); for(j=20; j<201; j++) __LCD_SetPixl(WHT); __Point_SCR(244, 20); for(j=20; j<201; j++) __LCD_SetPixl(WHT); __Point_SCR(288, 20); for(j=20; j<201; j++) __LCD_SetPixl(WHT); __Point_SCR(332, 20); for(j=20; j<201; j++) __LCD_SetPixl(WHT); __Point_SCR(398, 0); for(j= 0; j<239; j++) __LCD_SetPixl(WHT); Print_Str( 6, 185, 0x0005, PRN, "CH_A"); // 显示表格标题栏 Print_Str( 49, 185, 0x0005, PRN, "ZERO"); Print_Str( 93, 185, 0x0005, PRN, "DIFF"); Print_Str(137, 185, 0x0005, PRN, "VOLTAGE"); Print_Str(206, 185, 0x0105, PRN, "CH_B"); Print_Str(249, 185, 0x0105, PRN, "ZERO"); Print_Str(293, 185, 0x0105, PRN, "DIFF"); Print_Str(338, 185, 0x0105, PRN, "VOLTAGE"); for(i=0; i<=G_Attr[0].Yp_Max; i++){ Print_Str( 6, 166-(i*20), 0x0005, PRN, Y_Attr[i].STR); // 显示量程 Print_Str(206, 166-(i*20), 0x0105, PRN, Y_Attr[i].STR); Ma1[i] = Ka1[i]; Ma2[i] = Ka2[i]; Ma3[i] = Ka3[i]; // 备份校准前的参数 Mb1[i] = Kb1[i]; Mb2[i] = Kb2[i]; Mb3[i] = Kb3[i]; } while (1){ if(PD_Cnt == 0){ __Set(BACKLIGHT, 0); // 关闭背光 __Set(STANDBY, EN); // 进入省电状态 return; } __Set(CH_A_RANGE, Range); __Set(CH_B_RANGE, Range); Delayms(20); __Set(FIFO_CLR, W_PTR); Delayms(20); a_Avg = 2048; b_Avg = 2048; for(i=0; i <4096; i++){ DataBuf[i] = __Read_FIFO(); // 读入32位FIFO数据 a_Avg += (DataBuf[i] & 0xFF ); // 累计直流平均值 b_Avg += ((DataBuf[i]>>8) & 0xFF ); } TmpA = Ka1[Range] +(Ka2[Range]*(a_Avg/4096)+ 512)/1024; TmpB = Kb1[Range] +(Kb2[Range]*(b_Avg/4096)+ 512)/1024; if(Blink){ Blink = 0; switch (Step){ case 0: Range = 0; __Set(CH_A_OFFSET, ((1024+Ka3[Range])*40 + 512)/1024); __Set(CH_B_OFFSET, ((1024+Kb3[Range])*40 + 512)/1024); Print_Str( 8, 216, 0x0305, PRN, " PLEASE CONNECT"); Print_Str(29*8, 216, 0x0305, PRN, "INPUT TO "); Print_Str(38*8, 216, 0x0405, PRN, "GND "); Print_Str( 8, 6, 0x0305, PRN, " PRESS KEY TO CONFIRM THE INPUT VOLTAGE "); Print_Str(10*8, 6, 0x0405, Twink, " "); if(Channel == TRACK1){ Print_Str( 23*8, 216, 0x0005, PRN, " CH_A "); for(i=0; i<=G_Attr[0].Yp_Max; i++){ Ka1[i] = 0; Ka2[i] = 1024; Ka3[i] = 0; // 设置校准参数初值 } } if(Channel == TRACK2){ Print_Str( 23*8, 216, 0x0105, PRN, " CH_B "); for(i=0; i<=G_Attr[0].Yp_Max; i++){ Kb1[i] = 0; Kb2[i] = 1024; Kb3[i] = 0; // 设置校准参数初值 } } break; case 1: Print_Str( 8, 6, 0x0305, PRN, " AUTOMATIC CALIBRATION IN PROGRESS... "); if(Channel == TRACK1){ s8ToPercen(n, TmpA - 40); Print_Str( 45, 166-(Range*20), 0x0005, INV, n); Ka1[Range] -= TmpA - 40; } if(Channel == TRACK2){ s8ToPercen(n, TmpB - 40); Print_Str(245, 166-(Range*20), 0x0105, INV, n); Kb1[Range] -= TmpB - 40; } Range++; if(Range > G_Attr[0].Yp_Max){ Range = 0; Step++; } __Set(CH_A_OFFSET, ((1024+Ka3[Range])*40 + 512)/1024); __Set(CH_B_OFFSET, ((1024+Kb3[Range])*40 + 512)/1024); k = 0; break; case 2: k++; if(k >= 8) k = 0; if(Channel == TRACK1){ s8ToPercen(n, TmpA - 40); Print_Str( 45, 166-(Range*20), 0x0005, PRN, n); if(TmpA - 40 != 0) Ka1[Range] -= TmpA - 40; else k = 0; } if(Channel == TRACK2){ s8ToPercen(n, TmpB - 40); Print_Str(245, 166-(Range*20), 0x0105, PRN, n); if(TmpB - 40 != 0) Kb1[Range] -= TmpB - 40; else k = 0; } if(k == 0) Range++; if(Range > G_Attr[0].Yp_Max){ Range = 0; Step++; } __Set(CH_A_OFFSET, ((1024+Ka3[Range])*40 + 512)/1024); __Set(CH_B_OFFSET, ((1024+Kb3[Range])*40 + 512)/1024); break; case 3: k++; __Set(CH_A_OFFSET, ((1024+Ka3[Range])*160 + 512)/1024); __Set(CH_B_OFFSET, ((1024+Kb3[Range])*160 + 512)/1024); if((Channel == TRACK1)&&(TmpA > 140)) Step++; if((Channel == TRACK2)&&(TmpB > 140)) Step++; if(k > 20) Step++; break; case 4: k = 0; if(Channel == TRACK1){ s8ToPercen(n, TmpA - 160); Print_Str( 89, 166-(Range*20), 0x0005, INV, n); Ka3[Range] -= (1024*(TmpA-160)+80)/160; } if(Channel == TRACK2){ s8ToPercen(n, TmpB - 160); Print_Str(289, 166-(Range*20), 0x0105, INV, n); Kb3[Range] -= (1024*(TmpB-160)+80)/160; } Range++; if(Range > G_Attr[0].Yp_Max){ Range = 0; Step++; } __Set(CH_A_OFFSET, ((1024+Ka3[Range])* 160 + 512)/1024); __Set(CH_B_OFFSET, ((1024+Kb3[Range])* 160 + 512)/1024); break; case 5: k++; if(k >= 8) k = 0; if(Channel == TRACK1){ s8ToPercen(n, TmpA - 160); Print_Str( 89, 166-(Range*20), 0x0005, PRN, n); if(TmpA - 160 != 0) Ka3[Range] -= (1024*(TmpA-160)+80)/160; else k = 0; } if(Channel == TRACK2){ s8ToPercen(n, TmpB - 160); Print_Str(289, 166-(Range*20), 0x0105, PRN, n); if(TmpB - 160 != 0) Kb3[Range] -= (1024*(TmpB-160)+80)/160; else k = 0; } if(k == 0) Range++; if(Range > G_Attr[0].Yp_Max){ Range = 0; Step++; } __Set(CH_A_OFFSET, ((1024+Ka3[Range])* 160 + 512)/1024); __Set(CH_B_OFFSET, ((1024+Kb3[Range])* 160 + 512)/1024); break; case 6: k++; if(k > 20) Step++; Range = 0; if(m < 2){ __Set(CH_A_OFFSET, ((1024+Ka3[Range])*40 + 512)/1024); __Set(CH_B_OFFSET, ((1024+Kb3[Range])*40 + 512)/1024); if((Channel == TRACK1)&&(TmpA < 50)){ Step = 1; m++; } if((Channel == TRACK2)&&(TmpB < 50)){ Step = 1; m++; } } else { __Set(CH_A_OFFSET, ((1024+Ka3[Range])* 25 + 512)/1024); __Set(CH_B_OFFSET, ((1024+Kb3[Range])* 25 + 512)/1024); if((Channel == TRACK1)&&(TmpA < 55)) Step++; if((Channel == TRACK2)&&(TmpB < 55)) Step++; } break; case 7: Print_Str( 4*8, 216, 0x0305, PRN, " INPUT "); Print_Str(11*8, 216, 0x0405, Twink, (u8*)VS_STR[Range]); Print_Str(20*8, 216, 0x0305, PRN, " STANDARD VOLTAGE TO "); Print_Str( 8, 6, 0x0305, PRN, "MODIFY VOLTAGE: ... "); Print_Str(18*8, 6, 0x0405, Twink, "-"); Print_Str(22*8, 6, 0x0405, Twink, "+"); Print_Str(27*8, 6, 0x0305, PRN, "SELECT RANGE: --- "); Print_Str(42*8, 6, 0x0405, Twink, "<"); Print_Str(46*8, 6, 0x0405, Twink, ">"); if(Channel == TRACK1){ if(TmpA > 35){ Int2Str(n, (TmpA - 25)* Y_Attr[Range].SCALE, V_UNIT, 3, SIGN); } else { Int2Str(n, 0, V_UNIT, 3, SIGN); } Print_Str( 134, 166-(Range*20), 0x0005, Twink, n); Print_Str(41*8, 216, 0x0005, PRN, "CH_A "); } if(Channel == TRACK2){ if(TmpB > 35){ Int2Str(n, (TmpB - 25)* Y_Attr[Range].SCALE, V_UNIT, 3, SIGN); } else { Int2Str(n, 0, V_UNIT, 3, SIGN); } Print_Str( 334, 166-(Range*20), 0x0105, Twink, n); Print_Str(41*8, 216, 0x0105, PRN, "CH_B "); } break; case 8: //" PRESS --- TO SELECT THE NEXT OPERATION" m = 0; Print_Str( 8, 6, 0x0305, PRN, " PRESS --- "); Print_Str(12*8, 6, 0x0405, Twink, "<"); Print_Str(16*8, 6, 0x0405, Twink, ">"); Print_Str(17*8, 6, 0x0305, PRN, " TO SELECT THE NEXT OPERATION "); Print_Str( 8, 216, 0x0305, PRN, " PRESS TO "); Print_Str(14*8, 216, 0x0405, PRN, "CONFIRM THE RE-CALIBRATION "); Print_Str( 9*8, 216, 0x0405, Twink, " "); if(Channel == TRACK1) Print_Str(41*8, 216, 0x0005, PRN, "CH_A "); if(Channel == TRACK2) Print_Str(41*8, 216, 0x0105, PRN, "CH_B "); break; //" PRESS TO CONFIRM THE RE-CALIBRATION CH_A " case 9: // "SELECT THE CALIBRATION CH_A " Print_Str( 9*8, 216, 0x0405, Twink, " "); Print_Str(14*8, 216, 0x0405, PRN, "SELECT THE CALIBRATION "); if(Channel == TRACK1) Print_Str(37*8, 216, 0x0105, PRN, "CH_B "); if(Channel == TRACK2) Print_Str(37*8, 216, 0x0005, PRN, "CH_A "); break; case 10: // "Exit WITHOUT SAVE RESULTS " Print_Str( 9*8, 216, 0x0405, Twink, " "); Print_Str(14*8, 216, 0x0405, PRN, "Exit WITHOUT SAVE RESULTS "); break; case 11: // "Exit AND SAVE CALIBRATION RESULTS" Print_Str( 9*8, 216, 0x0405, Twink, " "); Print_Str(14*8, 216, 0x0405, PRN, "Exit AND SAVE CALIBRATION RESULTS"); break; case 12: // "Exit AND RESTORE SYSTEM DEFAULTS " Print_Str( 9*8, 216, 0x0405, Twink, " "); Print_Str(14*8, 216, 0x0405, PRN, "Exit AND RESTORE SYSTEM DEFAULTS "); break; } } if(Key_Buffer){ PD_Cnt = 600; // 重新设定等待时间600秒 if((Range <= G_Attr[0].Yp_Max)&&(Step == 7)){ if(Channel == TRACK1){ Print_Str(134, 166-(Range*20), 0x0005, PRN, n); } if(Channel == TRACK2){ Print_Str(334, 166-(Range*20), 0x0105, PRN, n); } } switch (Key_Buffer){ case KEY2: if(Step == 0) Step++; if((Step == 8)||(Step == 9)){ if(Step == 9) Channel = 1 - Channel; for(i=0; i<=G_Attr[0].Yp_Max; i++){ if(Channel == TRACK1){ Print_Str( 45, 166-(i*20), 0x0005, PRN, " "); Print_Str( 89, 166-(i*20), 0x0005, PRN, " "); Print_Str(134, 166-(i*20), 0x0005, PRN, " "); } if(Channel == TRACK2){ Print_Str(245, 166-(i*20), 0x0105, PRN, " "); Print_Str(289, 166-(i*20), 0x0105, PRN, " "); Print_Str(334, 166-(i*20), 0x0105, PRN, " "); } } Step = 0;; } if(Step >= 10){ if(Step == 10){ for(i=0; i<=G_Attr[0].Yp_Max; i++){ Ka1[i] = Ma1[i]; Ka2[i] = Ma2[i]; Ka3[i] = Ma3[i]; Kb1[i] = Mb1[i]; Kb2[i] = Mb2[i]; Kb3[i] = Mb3[i]; } Save_Param(); // 不保存校正后的参数 Print_Str( 8, 216, 0x0405, PRN, " "); } if(Step == 11){ Save_Param(); // 保存校正后的参数 Print_Str( 8, 216, 0x0405, PRN, " SAVING THE CALIBRATION DATA "); } if(Step == 12){ for(i=0; i<=G_Attr[0].Yp_Max; i++){ Ka1[i] = 0; Ka2[i] = 1024; Ka3[i] = 0; // 设置校准参数初值 Kb1[i] = 0; Kb2[i] = 1024; Kb3[i] = 0; } Save_Param(); // 清除校准参数,保存缺省值 Print_Str( 8, 216, 0x0405, PRN, " RESTORE DEFAULTS CALIBRATION DATA "); } Delayms(1000); App_init(); return; } break; case KEY3: break; case K_ITEM_DEC: if((Step == 7)&&(Range > 0)) Range--; if( Step >= 9) Step--; if( Step == 8) Step = 12; break; case K_ITEM_INC: if(Step >= 8) Step++; if(Step > 12) Step = 8; if(Step == 7) Range++; if(Range > G_Attr[0].Yp_Max){ Range = 0; Step++; } break; case K_INDEX_DEC: if(Step == 7){ if((Channel == TRACK1)&&(TmpA > 35)) Ka2[Range] -= 2; if((Channel == TRACK2)&&(TmpB > 35)) Kb2[Range] -= 2; } break; case K_INDEX_INC: if(Step == 7){ if((Channel == TRACK1)&&(TmpA > 35)) Ka2[Range] += 2; if((Channel == TRACK2)&&(TmpB > 35)) Kb2[Range] += 2; } break; } Key_Buffer = 0; } } }
/******************************************************************************* Clear_Screen: 清LCD显示器屏幕。 *******************************************************************************/ void Clear_Screen(unsigned short Color) { unsigned int i; __Point_SCR(0, 0); //X_pos=0,Y_pos=0 for(i=0;i<240*320;++i) __Set_Pixel(Color); }
static cell AMX_NATIVE_CALL amx_getpixel(AMX *amx, const cell *params) { // getpixel(x, y) __Point_SCR(params[1], params[2]); return __LCD_GetPixl(); }