mirror of
https://github.com/WeActStudio/WeActStudio.EpaperModule.git
synced 2026-08-16 13:13:45 +02:00
fix 8x6 char display bug
This commit is contained in:
@@ -635,8 +635,15 @@ void epd_paint_showString(uint16_t x, uint16_t y, uint8_t *chr, uint16_t size1,
|
||||
{
|
||||
epd_paint_showChar(x, y, *chr, size1, color);
|
||||
chr++;
|
||||
if (size1 == 8)
|
||||
{
|
||||
x += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += size1 / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// m^n
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -22,7 +22,7 @@ __initial_sp
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Heap_Size EQU 0x00002000
|
||||
Heap_Size EQU 0x00000200
|
||||
|
||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
__heap_base
|
||||
|
||||
@@ -104,8 +104,8 @@ void epd_io_init(void)
|
||||
gpio_init(GPIOB, &gpio_init_struct);
|
||||
|
||||
/* configure the epaper module spi2 mosi pin */
|
||||
// gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
// gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
// gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
// gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
|
||||
gpio_init_struct.gpio_pins = GPIO_PINS_15;
|
||||
gpio_init(GPIOB, &gpio_init_struct);
|
||||
@@ -158,15 +158,17 @@ void epd_write_data(uint8_t data)
|
||||
epd_cs_set();
|
||||
}
|
||||
|
||||
void epd_read_data(uint8_t reg,uint8_t *data,uint8_t length)
|
||||
void epd_read_data(uint8_t reg, uint8_t *data, uint8_t length)
|
||||
{
|
||||
epd_cs_reset();
|
||||
spi_i2s_data_transmit(SPI2, reg);
|
||||
while (spi_i2s_flag_get(SPI2, SPI_I2S_BF_FLAG) != RESET);
|
||||
for(uint32_t i=0;i<length;i++)
|
||||
while (spi_i2s_flag_get(SPI2, SPI_I2S_BF_FLAG) != RESET)
|
||||
;
|
||||
for (uint32_t i = 0; i < length; i++)
|
||||
{
|
||||
data[i] = spi_i2s_data_receive(SPI2);
|
||||
while (spi_i2s_flag_get(SPI2, SPI_I2S_BF_FLAG) != RESET);
|
||||
while (spi_i2s_flag_get(SPI2, SPI_I2S_BF_FLAG) != RESET)
|
||||
;
|
||||
}
|
||||
epd_cs_set();
|
||||
}
|
||||
@@ -268,13 +270,13 @@ void epd_init_internalTempSensor(void)
|
||||
epd_write_data(0x7F);
|
||||
epd_write_data(0xF0);
|
||||
}
|
||||
uint8_t data[3];
|
||||
uint8_t data[3];
|
||||
int32_t epd_get_internalTempSensor(void)
|
||||
{
|
||||
|
||||
uint32_t temp;
|
||||
|
||||
epd_read_data(0x1B,data,3);
|
||||
epd_read_data(0x1B, data, 3);
|
||||
|
||||
temp = data[0];
|
||||
temp = temp << 4 | data[1] >> 4;
|
||||
@@ -604,7 +606,7 @@ void epd_paint_showChar(uint16_t x, uint16_t y, uint16_t chr, uint16_t size1, ui
|
||||
uint16_t i, m, temp, size2, chr1;
|
||||
uint16_t x0, y0;
|
||||
x += 1, y += 1, x0 = x, y0 = y;
|
||||
if(x-size1 > EPD_H)
|
||||
if (x - size1 > EPD_H)
|
||||
return;
|
||||
if (size1 == 8)
|
||||
size2 = 6;
|
||||
@@ -656,8 +658,15 @@ void epd_paint_showString(uint16_t x, uint16_t y, uint8_t *chr, uint16_t size1,
|
||||
{
|
||||
epd_paint_showChar(x, y, *chr, size1, color);
|
||||
chr++;
|
||||
if (size1 == 8)
|
||||
{
|
||||
x += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += size1 / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// m^n
|
||||
@@ -738,8 +747,8 @@ void epd_paint_showChinese(uint16_t x, uint16_t y, uint16_t num, uint16_t size1,
|
||||
void epd_paint_showPicture(uint16_t x, uint16_t y, uint16_t sizex, uint16_t sizey, const uint8_t BMP[], uint16_t Color)
|
||||
{
|
||||
uint16_t j = 0;
|
||||
uint16_t i, n=0, temp=0, m=0;
|
||||
uint16_t x0=0, y0=0;
|
||||
uint16_t i, n = 0, temp = 0, m = 0;
|
||||
uint16_t x0 = 0, y0 = 0;
|
||||
x += 1, y += 1, x0 = x, y0 = y;
|
||||
sizey = sizey / 8 + ((sizey % 8) ? 1 : 0);
|
||||
for (n = 0; n < sizey; n++)
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>App</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
||||
Binary file not shown.
+746
-745
File diff suppressed because it is too large
Load Diff
@@ -634,8 +634,15 @@ void epd_paint_showString(uint16_t x, uint16_t y, uint8_t *chr, uint16_t size1,
|
||||
{
|
||||
epd_paint_showChar(x, y, *chr, size1, color);
|
||||
chr++;
|
||||
if (size1 == 8)
|
||||
{
|
||||
x += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += size1 / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// m^n
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
Toolchain=
|
||||
Series=
|
||||
Description=
|
||||
Address=0x08000000
|
||||
Target Path=obj\EpaperModuleTest_CH32V103.hex
|
||||
Erase All=true
|
||||
Program=true
|
||||
Verify=true
|
||||
Reset=true
|
||||
|
||||
Vendor=WCH
|
||||
MCU=CH32V103C8T6
|
||||
Mcu Type=CH32V10x
|
||||
Link=WCH-Link
|
||||
@@ -634,8 +634,15 @@ void epd_paint_showString(uint16_t x, uint16_t y, uint8_t *chr, uint16_t size1,
|
||||
{
|
||||
epd_paint_showChar(x, y, *chr, size1, color);
|
||||
chr++;
|
||||
if (size1 == 8)
|
||||
{
|
||||
x += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += size1 / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// m^n
|
||||
|
||||
@@ -624,8 +624,15 @@ void epd_paint_showString(uint16_t x, uint16_t y, uint8_t *chr, uint16_t size1,
|
||||
{
|
||||
epd_paint_showChar(x, y, *chr, size1, color);
|
||||
chr++;
|
||||
if (size1 == 8)
|
||||
{
|
||||
x += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += size1 / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// m^n
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -624,8 +624,15 @@ void epd_paint_showString(uint16_t x, uint16_t y, uint8_t *chr, uint16_t size1,
|
||||
{
|
||||
epd_paint_showChar(x, y, *chr, size1, color);
|
||||
chr++;
|
||||
if (size1 == 8)
|
||||
{
|
||||
x += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += size1 / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// m^n
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
@@ -275,7 +275,7 @@
|
||||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>255</CpuCode>
|
||||
<DebugOpt>
|
||||
|
||||
BIN
Binary file not shown.
+883
-883
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
del *.bak /s
|
||||
del *.ddk /s
|
||||
del *.edk /s
|
||||
del *.lst /s
|
||||
del *.lnp /s
|
||||
del *.mpf /s
|
||||
del *.mpj /s
|
||||
del *.obj /s
|
||||
del *.omf /s
|
||||
::del *.opt /s ::不允许删除JLINK的设置
|
||||
del *.plg /s
|
||||
del *.rpt /s
|
||||
del *.tmp /s
|
||||
del *.__i /s
|
||||
del *.crf /s
|
||||
del *.o /s
|
||||
del *.d /s
|
||||
::del *.axf /s
|
||||
del *.tra /s
|
||||
del *.dep /s
|
||||
del JLinkLog.txt /s
|
||||
|
||||
del *.iex /s
|
||||
del *.htm /s
|
||||
del *.sct /s
|
||||
del *.map /s
|
||||
del *.mxproject /s
|
||||
exit
|
||||
Reference in New Issue
Block a user