cuu 2 years ago
parent
commit
c1215b0f1d
2 changed files with 8 additions and 3 deletions
  1. 3 0
      Code/thermal_printer/config.h
  2. 5 3
      Code/thermal_printer/printer.c

+ 3 - 0
Code/thermal_printer/config.h

@@ -1,6 +1,9 @@
 #ifndef CONFIG_H
 #define CONFIG_H
 
+#include <freetype2/ft2build.h>
+#include <freetype/freetype.h>
+
 ///raspberry pi CM3 
 
 #define BCM_GPIO_28 28

+ 5 - 3
Code/thermal_printer/printer.c

@@ -432,9 +432,11 @@ uint8_t print_lines_ft(CONFIG*cfg) {
   
   uint8_t lastidx,lastw,lastj;
   uint8_t row;
-  
+  uint16_t line_bits;
+    
   int8_t  left = ser_cache.idx;
-
+  uint8_t rv;
+  
   line_bits=cfg->margin.width;
   dot_line_idx = line_bits/8;
   dot_line_bitsidx = line_bits%8;
@@ -475,7 +477,7 @@ uint8_t print_lines_ft(CONFIG*cfg) {
           if(w > 0 && (w%8) == 0) j++;
           if(dot_line_bitsidx > 7 ){
             dot_line_idx++;
-            dot_line_bitxidx=0;
+            dot_line_bitsidx=0;
           }
           
           unsigned char p =