11
58
919
高级会员
使用道具 举报 送花
14
600
2215
荣誉版主
//都查表了,内存又那么大,直接来个大点的数组好了 aiData[]={ 0,0,0,0,0,0,0,1,//0x01 0,0,0,0,0,0,1,1,//0x03 0,0,0,0,0,1,1,1,//0x07 0,0,0,0,1,1,1,1,//0x0f //0x1f //0x3f //0x7f //0xff }复制代码
4
75
877
xiangz*** 发表于 2024-5-20 00:44
lijun*** 发表于 2024-5-20 03:35 不管怎么运算,要想快,必须先把变量定义为data类型
8
318
1835
金牌会员
#include <STC32G.H> volatile unsigned char aiData[] = {0x1,0x3,0x7,0xF,0x1F,0x3F,0x7F,0xFF}; volatile unsigned char iIndex; volatile unsigned char iIndexa; volatile unsigned char edata iByte; volatile unsigned char iBit; sbit iByte0 = iByte^0; sbit iByte1 = iByte^1; sbit iByte2 = iByte^2; sbit iByte3 = iByte^3; sbit iByte4 = iByte^4; sbit iByte5 = iByte^5; sbit iByte6 = iByte^6; sbit iByte7 = iByte^7; void main() { WTST = 0; EAXFR = 1; CKCON = 0; P0M1 = 0xF0; P0M0 = 0x00; EA = 0; iIndex = 0; while (1) { if (iIndex > 63) { iIndex = 0; P03 = 0; } P01 = 0; iIndexa = 63 - iIndex; iByte = iIndexa >> 4; iBit = iIndexa & 0x0F; switch(iBit) { case 0:P03=iByte0;break; case 1:P03=iByte1;break; case 2:P03=iByte2;break; case 3:P03=iByte3;break; case 4:P03=iByte4;break; case 5:P03=iByte5;break; case 6:P03=iByte6;break; case 7:P03=iByte7;break; } P01 = 1; iIndex++; } }复制代码
Lkck*** 发表于 2024-5-20 09:34
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|深圳国芯人工智能有限公司 ( 粤ICP备2022108929号-2 )
GMT+8, 2025-5-7 11:56 , Processed in 0.159326 second(s), 111 queries .
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.