Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mini receit thermal printer library
24-03-2013, 12:12 PM,
RE: Mini receit thermal printer library
It would be easier to help you if we get the whole code you wrote.
Please attach it to this post.

(24-03-2013, 11:36 AM)ludioprgrm Wrote: Hi everybody !

I come back with some news. Before attack the pinguino I've tested my library with the mikroC compiler with success ; so I've attacked the compilation using pinguino libraries with the pinguino IDE & Compilers.

Unfortunately, the program (the pde became user.c ; if I understood as well) and the library doesn't compile.

With the IDE X.3 and X.4 ; no error is visible, nothing in the compilation log.

So I've tried the manual compilation and, now, I've the same error which came each time.

There is an erreor "Too many parameters" with
serial_putchar( temp ) //with temp as unsigned char

switch(toupper(value)) { // value is also unsigned char

and on the line of the pprintf

void printer_printf(char *fmt, ...)
    va_list args;
    va_start(args, fmt);
    pprintf(printer_write, fmt, args);

I think these errors occurs because of a missing declaration in my library (a missing include). But I don't know that files to include.

In fine I have an error line 287 of my user.c file ... which haves only 71 lines....

My compilation script is this following :
SET PATH=%PATH%;"C:\Users\ludovic\Desktop\work\X4\win32\p8\bin"

sdcc -mpic16 -p18f26j50 -I"C:\Users\ludovic\Desktop\work\X4\p8\include" -I"C:\Users\ludovic\Desktop\work\X4\p8\include\non-free" -I"C:\Users\ludovic\Desktop\work\X4\p8\include\pinguino\core" -I"C:\Users\ludovic\Desktop\work\X4\p8\include\pinguino\libraries" -I"C:\Users\ludovic\Desktop\work\X4\source" -Dboot4 -DPINGUINO26J50 --obanksel=9 --optimize-cmp --optimize-df --denable-peeps --ivt-loc=3072 --compile-only "C:\Users\ludovic\Desktop\work\X4\source\main.c" -o"C:\Users\ludovic\Desktop\work\X4\source\main.o" 2> compilation.txt

sdcc -mpic16 -p18f26j50 -I"C:\Users\ludovic\Desktop\work\X4\p8\include" -I"C:\Users\ludovic\Desktop\work\X4\p8\include\non-free" -I"C:\Users\ludovic\Desktop\work\X4\p8\include\pinguino\core" -I"C:\Users\ludovic\Desktop\work\X4\p8\include\pinguino\libraries" -L"C:\Users\ludovic\Desktop\work\X4\p8\lib" -L"C:\Users\ludovic\Desktop\work\X4\p8\lib\non-free" -Dboot4 -DPINGUINO26J50 --obanksel=9 --optimize-cmp --optimize-df --denable-peeps --ivt-loc=3072 --no-crt "C:\Users\ludovic\Desktop\work\X4\source\main.o" libc18f.lib libm18f.lib libio18f26j50.lib -Wl-s.\p8\lkr\boot4.18f26j50.lkr,-m -o"C:\Users\ludovic\Desktop\work\X4\source\main.hex" 2> linkage.txt

Many thanks !
It is easier to complain than it is to do, but it is better to do than it is to complain.
24-03-2013, 01:21 PM, (This post was last modified: 24-03-2013, 01:22 PM by ludioprgrm.)
RE: Mini receit thermal printer library
Yes I'll post my files ; but I have to clean theme before.

ANd I found my mistakes : I use extern declaration of the top of my printer.c library instead of all c files I need (i thought that all will me linked with .lib).

So, now, with all needeed include ; it compiles !!

I add at the top of my lib this :
#include "printer.h"
#include <stdarg.h>
#include <ctype.h>
#include <millis.c>
#include <serial.c>
#include <stdio.c>

And now I have my main.hex up to date (43ko) and main.lst (538ko !!!).

As I cleaned all my files, update the pdl and I'll send you. I hope my job let me enought time to make a prototype PCB to test everything is ok.

Forum Jump:

Users browsing this thread: 1 Guest(s)