【发布时间】:2018-01-18 04:03:28
【问题描述】:
我正在使用 Bodmer TFT_eSPI 库。显示位图绘图的示例 (TFT_Flash_Bitmap),但在我的应用程序中集成该代码始终会产生 ESP 异常 9:内存对齐异常。
注释掉 pushColors() 或 pushColor() 调用可以避免崩溃,所以我怀疑它在那里发生。
我认为错误都是我的。谁能帮我找到原因/解决方案?
谢谢,
丹尼
Exception (9):
epc1=0x402071fc epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000001 depc=0x00000000
/*
* Note the Bodmer version of drawIcon is for FLASH memory. No such thing here.
* See TFT_eSPI/examples/320 x 240/TFT_Flash_Bitmap , moved from example to class method here.
*/
void Oled::drawIcon(const uint16_t *icon, int16_t x, int16_t y, uint16_t width, uint16_t height) {
#if 0
uint16_t pixbuf[OLED_BS];
setWindow(x, y, x + width - 1, y + height - 1);
// How many whole buffers to send ?
uint16_t nb = ((uint16_t)height * width) / OLED_BS;
// Fill and send that many buffers to TFT
for (int i = 0; i < nb; i++) {
for (int j = 0; j < OLED_BS; j++) {
pixbuf[j] = icon[i * OLED_BS + j];
}
// pushColors(pixbuf, OLED_BS);
}
// How many pixels not yet sent ?
uint16_t np = ((uint16_t)height * width) % OLED_BS;
// Send any partial buffer left over
if (np) {
for (int i = 0; i < np; i++)
pixbuf[i] = icon[nb * OLED_BS + i];
// pushColors(pixbuf, np);
}
#else
setWindow(x, y, x + width - 1, y + height - 1);
for (int i = 0; i < width * height; i++)
; // pushColor(icon[i]);
#endif
}
【问题讨论】:
标签: exception alignment esp8266