由于不明原因Flash字库的头索引乱了,导致一直无法定位,重新计算了位置。
给show str函数加入长度限制。 Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1538997678727627292" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="618543812541383522" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1538997678727627292" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="618543812541383522" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
66BE74F758C12D739921AEA421D593D3=3
|
||||
8DF89ED150041C4CBC7CB9A9CAA90856=C51B2B4ECCDABDF7BBEE78EFB628823D
|
||||
DC22A860405A8BF2F2C095E5B6529F12=C51B2B4ECCDABDF7BBEE78EFB628823D
|
||||
8DF89ED150041C4CBC7CB9A9CAA90856=DE78FCE0BA5B3294914EFBF8CCE3C6CE
|
||||
DC22A860405A8BF2F2C095E5B6529F12=C0E5DD146C4FCAF07F69BC2160CDF33F
|
||||
eclipse.preferences.version=1
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+12283
-6074
File diff suppressed because it is too large
Load Diff
+855
-605
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -66,8 +66,8 @@ all: main-build
|
||||
main-build: 103ze_code.elf secondary-outputs
|
||||
|
||||
# Tool invocations
|
||||
103ze_code.elf: $(OBJS) $(USER_OBJS) C:\Users\13370\Desktop\smartbooks\103ze\STM32F103ZETX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||
arm-none-eabi-gcc -o "103ze_code.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m3 -T"C:\Users\13370\Desktop\smartbooks\103ze\STM32F103ZETX_FLASH.ld" --specs=nosys.specs -Wl,-Map="103ze_code.map" -Wl,--gc-sections -static --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
|
||||
103ze_code.elf: $(OBJS) $(USER_OBJS) C:\Users\kevin\Desktop\smartbooks\103ze\STM32F103ZETX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
|
||||
arm-none-eabi-gcc -o "103ze_code.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m3 -T"C:\Users\kevin\Desktop\smartbooks\103ze\STM32F103ZETX_FLASH.ld" --specs=nosys.specs -Wl,-Map="103ze_code.map" -Wl,--gc-sections -static --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
c.c:14:5:my_main 656 static
|
||||
c.c:14:5:my_main 672 static
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
text.c:217:9:font_init 16 static
|
||||
text.c:240:6:Get_HzMat 32 static
|
||||
text.c:276:6:Show_Font 104 static
|
||||
text.c:308:6:LCD_ShowChar 32 static
|
||||
text.c:346:6:LCD_ShowString 40 static
|
||||
text.c:241:6:Get_HzMat 32 static
|
||||
text.c:277:6:Show_Font 104 static
|
||||
text.c:309:6:LCD_ShowChar 32 static
|
||||
text.c:347:6:LCD_ShowString 40 static
|
||||
|
||||
+13
-7
@@ -20,19 +20,25 @@ int my_main()
|
||||
char str[16];
|
||||
LCD_BL(0);
|
||||
LCDx_Init();
|
||||
LCD_Clear(GRAY);
|
||||
|
||||
if(font_init())
|
||||
{
|
||||
LCD_ShowString(0,16,(uint8_t *)"erro",16,RED,BLUE);
|
||||
LCD_ShowString(0,16,(uint8_t *)"erro",16,RED,BLUE,64);
|
||||
}
|
||||
LCD_Clear(GRAY);
|
||||
/*
|
||||
|
||||
f_mount(&SD,"0:",1);
|
||||
res=f_open(&fil,"0:/demo.txt",FA_READ);
|
||||
res=f_read(&fil,fil_buff,16,(UINT*)&br);
|
||||
res=f_read(&fil,fil_buff,32,(UINT*)&br);
|
||||
sprintf(str,"%s\0\0",fil_buff);
|
||||
LCD_ShowString(0,0,str,16,RED,BLUE);
|
||||
*/
|
||||
LCD_ShowString(0,0,"123dsjvn°¡",12,RED,BLUE);
|
||||
LCD_ShowString(0,0,str,16,RED,BLUE,64);
|
||||
|
||||
/*
|
||||
sprintf(str,"%02x\n%02x\n%02x\n%02x\n%02x",ftinfo.fontok,ftinfo.ugbkaddr,ftinfo.ugbksize,ftinfo.f12addr,ftinfo.gbk12size);
|
||||
LCD_ShowString(0,0,str,12,RED,BLUE);
|
||||
|
||||
LCD_ShowString(0,100,"163165sdf°¢¶û·¨",12,RED,BLUE);
|
||||
*/
|
||||
while(1)
|
||||
{
|
||||
|
||||
|
||||
+9
-4
@@ -223,7 +223,8 @@ uint8_t font_init(void)
|
||||
W25QXX_Read((uint8_t*)&ftinfo,FONTINFOADDR,sizeof(ftinfo));//读出ftinfo结构体数据
|
||||
if(ftinfo.fontok==0XAA)
|
||||
{
|
||||
ftinfo.f12addr+=1;
|
||||
ftinfo.f12addr=0x0042a929;
|
||||
ftinfo.f16addr=0x004b6d89;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -343,9 +344,9 @@ void LCD_ShowChar(uint16_t x,uint16_t y,uint8_t num,uint8_t size,uint16_t bg,uin
|
||||
//size:字体大小
|
||||
//*p:字符串起始地址
|
||||
|
||||
void LCD_ShowString(uint16_t x,uint16_t y,uint8_t *p,uint8_t size,uint16_t bg,uint16_t color)
|
||||
void LCD_ShowString(uint16_t x,uint16_t y,uint8_t *p,uint8_t size,uint16_t bg,uint16_t color,uint16_t len)
|
||||
{
|
||||
while(*p!='\0')
|
||||
while(len--)
|
||||
{
|
||||
|
||||
if(x>=lcddev.width)
|
||||
@@ -353,6 +354,10 @@ void LCD_ShowString(uint16_t x,uint16_t y,uint8_t *p,uint8_t size,uint16_t bg,ui
|
||||
x=0;
|
||||
y+=size;
|
||||
}
|
||||
if(*p=='\0')
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(*p=='\r')
|
||||
{
|
||||
p++;
|
||||
@@ -371,7 +376,7 @@ void LCD_ShowString(uint16_t x,uint16_t y,uint8_t *p,uint8_t size,uint16_t bg,ui
|
||||
{
|
||||
Show_Font(x,y,p,size,bg,color);
|
||||
p++;
|
||||
x+=size;
|
||||
x+=size;
|
||||
}
|
||||
p++;
|
||||
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
//前面4M被fatfs占用了.
|
||||
//4M以后紧跟3个字库+UNIGBK.BIN,总大小3.09M,被字库占用了,不能动!
|
||||
//5.10M以后,用户可以自由使用.建议用最后的100K字节比较好.
|
||||
__packed typedef struct
|
||||
typedef struct
|
||||
{
|
||||
uint8_t fontok; //字库存在标志,0XAA,字库正常;其他,字库不存在
|
||||
uint32_t ugbkaddr; //unigbk的地址
|
||||
@@ -32,6 +32,6 @@ extern _font_info ftinfo;
|
||||
uint8_t font_init(void);
|
||||
void Show_Font(uint16_t x,uint16_t y,uint8_t *font,uint8_t size,uint16_t bg,uint16_t color);
|
||||
void LCD_ShowChar(uint16_t x,uint16_t y,uint8_t num,uint8_t size,uint16_t bg,uint16_t color);
|
||||
void LCD_ShowString(uint16_t x,uint16_t y,uint8_t *p,uint8_t size,uint16_t bg,uint16_t color);
|
||||
void LCD_ShowString(uint16_t x,uint16_t y,uint8_t *p,uint8_t size,uint16_t bg,uint16_t color,uint16_t len);
|
||||
|
||||
#endif /* TEXT_H_ */
|
||||
|
||||
Reference in New Issue
Block a user