本帖最后由 konway 于 2016-12-24 15:36 编辑 程序原本是51程序,移到STM32的时候有个地方报错: unsugned char code bmp[]={ //0, 8 ;<<----Row count(DB format) //0, 128 ;<<----Column count(DB format) 0x00,0x00,0x00,0x10,0x61,0x06,0xE0,0x00,0x26,0x22,0x1A,0x02,0xC2,0x0A,0x12,0x32,0x06,0x02,0x00,0x10,0x10,0x10,0xFE,0x10, 0x10,0xFE,0x00,0x00,0xFC,0x00,0x00,0x00,0xFE,0x00,0x00,0x04,0x04,0x04,0xE4,0x24,0x24,0x25,0xFE,0x24,0x24,0x24,0x24,0xE4, 0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x7E,0x2A,0x2A,0x2A,0x2A,0x2A,0x2A,0x7E,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0xFA,0xAA, 0xAA,0xAA,0xFF,0xAA,0xAA,0xAA,0xFA,0x02,0x02,0x00,0x00,0x40,0x41,0xCE,0x04,0x00,0xF0,0x90,0x90,0x90,0xFF,0x90,0x90,0x90, 0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFC,0x03,0x20,0x20,0x11,0x11,0x09,0x05,0xFF,0x05,0x09,0x19, 0x31,0x10,0x00,0x08,0x08,0x04,0x47,0x24,0x18,0x07,0x00,0x00,0x1F,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x3F,0x00, 0x00,0x00,0xFF,0x00,0x00,0x10,0x20,0x1F,0x00,0x00,0x00,0x00,0x7F,0x25,0x25,0x25,0x25,0x7F,0x00,0x00,0x7F,0x25,0x25,0x25, 0x25,0x7F,0x00,0x00,0x42,0x72,0x02,0x3A,0x42,0x42,0x4B,0x52,0x42,0x62,0x02,0x13,0x66,0x00,0x00,0x40,0x20,0x1F,0x20,0x40, 0x5F,0x48,0x48,0x48,0x4F,0x48,0x48,0x48,0x5F,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xE0,0x20,0x20,0x20,0x20,0xFC,0x20,0x20,0x20,0x20,0xE0,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x88,0x48, 0x28,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x90,0xD0,0xB0,0x9C,0x90,0x90,0x90,0x90,0x10,0x10,0x10,0x00,0xF8, 0x08,0xC8,0x38,0x08,0x00,0xF8,0x28,0x28,0x28,0x28,0x28,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x38,0x10,0x00,0x00, 0x38,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x40,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x08,0x08,0xF8,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x11,0x11,0x11,0x11,0xFF,0x11,0x11,0x11,0x11,0x3F,0x00,0xC0,0x00,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x04,0x06,0x04,0x00,0x08,0x04,0x02,0x01,0xFF,0x24,0x24,0x24,0xA4, 0x24,0x24,0xFF,0x00,0x00,0x00,0x00,0xFF,0x00,0x08,0x11,0x0E,0x00,0xFF,0x01,0x83,0x0D,0x31,0x49,0x85,0x80,0x80,0x00,0x00, 0x04,0x82,0xC1,0xA0,0x90,0x8E,0xC4,0x40,0x40,0x50,0xE1,0xC3,0x06,0x02,0x00,0x00,0x00,0x7E,0x12,0x12,0x12,0x12,0x12,0x12, 0x3E,0x00,0x80,0x00,0xFF,0x00,0x00,0x00,0xE0,0x10,0x10,0x10,0x10,0x70,0x00,0x10,0xF0,0x10,0x00,0x00,0x10,0xF0,0x10,0x10, 0xF0,0x10,0x10,0xD0,0x10,0x20,0x00,0x10,0xF0,0x60,0x80,0x00,0x10,0xF0,0x10,0x20,0x10,0x10,0x10,0x90,0x70,0x10,0x00,0x11, 0xF1,0x11,0x01,0x01,0x11,0xF1,0x10,0x10,0xF0,0x10,0x10,0xD0,0x11,0x22,0x01,0x10,0xF0,0x60,0x80,0x00,0x10,0xF0,0x10,0x00, 0x00,0x10,0x10,0xF3,0x10,0x10,0x00,0x10,0x11,0xF3,0x11,0x10,0x00,0x10,0xF0,0x63,0x80,0x00,0x10,0xF0,0x10,0x83,0x61,0x10, 0x10,0x10,0x70,0x00,0x11,0xF0,0x10,0x00,0x00,0x10,0xF1,0x10,0x10,0xF0,0x10,0x00,0x00,0x10,0xF1,0x10,0x00,0x10,0x10,0xF0, 0x10,0x10,0x00,0x10,0xF0,0x10,0x10,0x10,0x20,0xC0,0x00,0x11,0x10,0xF0,0x10,0x10,0x70,0x41,0x42,0x42,0x44,0x38,0x00,0x40, 0x7F,0x42,0x02,0x02,0x42,0x7F,0x40,0x40,0x7F,0x41,0x41,0x47,0x40,0x30,0x00,0x40,0x7F,0x40,0x01,0x0E,0x30,0x7F,0x00,0x40, 0x70,0x4C,0x42,0x41,0x40,0x30,0x00,0x40,0x7F,0x42,0x02,0x02,0x42,0x7F,0x40,0x40,0x7F,0x41,0x41,0x47,0x40,0x30,0x00,0x40, 0x7F,0x40,0x01,0x0E,0x30,0x7F,0x00,0x80,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x40,0x40,0x7F,0x40,0x40,0x00,0x40,0x7F,0x40, 0x01,0x0E,0x30,0x7F,0x00,0x0F,0x30,0x40,0x40,0x44,0x3C,0x04,0x40,0x7F,0x42,0x02,0x02,0x42,0x7F,0x40,0x00,0x3F,0x40,0x40, 0x40,0x40,0x3F,0x00,0x00,0x40,0x40,0x7F,0x40,0x40,0x00,0x40,0x7F,0x40,0x40,0x40,0x20,0x1F,0x00,0x40,0x40,0x7F,0x40,0x40, 0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00, 0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00, 0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x01,0xC1,0x31,0x09,0x08,0x08,0x38,0x00,0x00, 0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x08,0xF8, 0x08,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00, 0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00, 0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00, 0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00, 0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,0x30,0x30,0x00,0x80,0xB0,0x70,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,0x00, 0x20,0x3F,0x20,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,0x30,0x30, }; 调用它的程序是: void showpic(char *k) { int i,j; for(i=0;i<8;i++) { for(j=0;j<128;j++) { write_data(*k++); } } } 调用时: showpic(bmp); 在keil 51时编译没问题。 ================================= 下面看看STM32后的问题: const unsigned char bmp[]={ //0, 8 ;<<----Row count(DB format) //0, 128 ;<<----Column count(DB format) 0x00,0x00,0x00,0x10,0x61,0x06,0xE0,0x00,0x26,0x22,0x1A,0x02,0xC2,0x0A,0x12,0x32,0x06,0x02,0x00,0x10,0x10,0x10,0xFE,0x10, 0x10,0xFE,0x00,0x00,0xFC,0x00,0x00,0x00,0xFE,0x00,0x00,0x04,0x04,0x04,0xE4,0x24,0x24,0x25,0xFE,0x24,0x24,0x24,0x24,0xE4, 0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x7E,0x2A,0x2A,0x2A,0x2A,0x2A,0x2A,0x7E,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0xFA,0xAA, 0xAA,0xAA,0xFF,0xAA,0xAA,0xAA,0xFA,0x02,0x02,0x00,0x00,0x40,0x41,0xCE,0x04,0x00,0xF0,0x90,0x90,0x90,0xFF,0x90,0x90,0x90, 0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFC,0x03,0x20,0x20,0x11,0x11,0x09,0x05,0xFF,0x05,0x09,0x19, 0x31,0x10,0x00,0x08,0x08,0x04,0x47,0x24,0x18,0x07,0x00,0x00,0x1F,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x3F,0x00, 0x00,0x00,0xFF,0x00,0x00,0x10,0x20,0x1F,0x00,0x00,0x00,0x00,0x7F,0x25,0x25,0x25,0x25,0x7F,0x00,0x00,0x7F,0x25,0x25,0x25, 0x25,0x7F,0x00,0x00,0x42,0x72,0x02,0x3A,0x42,0x42,0x4B,0x52,0x42,0x62,0x02,0x13,0x66,0x00,0x00,0x40,0x20,0x1F,0x20,0x40, 0x5F,0x48,0x48,0x48,0x4F,0x48,0x48,0x48,0x5F,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xE0,0x20,0x20,0x20,0x20,0xFC,0x20,0x20,0x20,0x20,0xE0,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x88,0x48, 0x28,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x90,0xD0,0xB0,0x9C,0x90,0x90,0x90,0x90,0x10,0x10,0x10,0x00,0xF8, 0x08,0xC8,0x38,0x08,0x00,0xF8,0x28,0x28,0x28,0x28,0x28,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x38,0x10,0x00,0x00, 0x38,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x40,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x48,0x08,0x08,0xF8,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x11,0x11,0x11,0x11,0xFF,0x11,0x11,0x11,0x11,0x3F,0x00,0xC0,0x00,0x04, 0x04,0x04,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x04,0x06,0x04,0x00,0x08,0x04,0x02,0x01,0xFF,0x24,0x24,0x24,0xA4, 0x24,0x24,0xFF,0x00,0x00,0x00,0x00,0xFF,0x00,0x08,0x11,0x0E,0x00,0xFF,0x01,0x83,0x0D,0x31,0x49,0x85,0x80,0x80,0x00,0x00, 0x04,0x82,0xC1,0xA0,0x90,0x8E,0xC4,0x40,0x40,0x50,0xE1,0xC3,0x06,0x02,0x00,0x00,0x00,0x7E,0x12,0x12,0x12,0x12,0x12,0x12, 0x3E,0x00,0x80,0x00,0xFF,0x00,0x00,0x00,0xE0,0x10,0x10,0x10,0x10,0x70,0x00,0x10,0xF0,0x10,0x00,0x00,0x10,0xF0,0x10,0x10, 0xF0,0x10,0x10,0xD0,0x10,0x20,0x00,0x10,0xF0,0x60,0x80,0x00,0x10,0xF0,0x10,0x20,0x10,0x10,0x10,0x90,0x70,0x10,0x00,0x11, 0xF1,0x11,0x01,0x01,0x11,0xF1,0x10,0x10,0xF0,0x10,0x10,0xD0,0x11,0x22,0x01,0x10,0xF0,0x60,0x80,0x00,0x10,0xF0,0x10,0x00, 0x00,0x10,0x10,0xF3,0x10,0x10,0x00,0x10,0x11,0xF3,0x11,0x10,0x00,0x10,0xF0,0x63,0x80,0x00,0x10,0xF0,0x10,0x83,0x61,0x10, 0x10,0x10,0x70,0x00,0x11,0xF0,0x10,0x00,0x00,0x10,0xF1,0x10,0x10,0xF0,0x10,0x00,0x00,0x10,0xF1,0x10,0x00,0x10,0x10,0xF0, 0x10,0x10,0x00,0x10,0xF0,0x10,0x10,0x10,0x20,0xC0,0x00,0x11,0x10,0xF0,0x10,0x10,0x70,0x41,0x42,0x42,0x44,0x38,0x00,0x40, 0x7F,0x42,0x02,0x02,0x42,0x7F,0x40,0x40,0x7F,0x41,0x41,0x47,0x40,0x30,0x00,0x40,0x7F,0x40,0x01,0x0E,0x30,0x7F,0x00,0x40, 0x70,0x4C,0x42,0x41,0x40,0x30,0x00,0x40,0x7F,0x42,0x02,0x02,0x42,0x7F,0x40,0x40,0x7F,0x41,0x41,0x47,0x40,0x30,0x00,0x40, 0x7F,0x40,0x01,0x0E,0x30,0x7F,0x00,0x80,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x40,0x40,0x7F,0x40,0x40,0x00,0x40,0x7F,0x40, 0x01,0x0E,0x30,0x7F,0x00,0x0F,0x30,0x40,0x40,0x44,0x3C,0x04,0x40,0x7F,0x42,0x02,0x02,0x42,0x7F,0x40,0x00,0x3F,0x40,0x40, 0x40,0x40,0x3F,0x00,0x00,0x40,0x40,0x7F,0x40,0x40,0x00,0x40,0x7F,0x40,0x40,0x40,0x20,0x1F,0x00,0x40,0x40,0x7F,0x40,0x40, 0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00, 0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00, 0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x01,0xC1,0x31,0x09,0x08,0x08,0x38,0x00,0x00, 0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x08,0xF8, 0x08,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00, 0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00, 0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00, 0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00, 0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,0x30,0x30,0x00,0x80,0xB0,0x70,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,0x00, 0x20,0x3F,0x20,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,0x30,0x30, }; 调用的子程序: void showpic1(unsigned char *k) { int i,j; for(i=0;i<8;i++) { for(j=0;j<128;j++) { write_data(*k++); } } } 按以下写法调用时报错。 提示:../Src/main.c(175): error: #167: argument of type "const unsigned char *" is incompatible with parameter of type "unsigned char *" =============================================== showpic(bmp); =================== 把const去掉,编译就OK,可是我又想把这个数组放在FLASH里,该怎么写才正确?? |
评分
查看全部评分
that is ok,TKS!