Menu

Lets find the LCD

2025-01-10
2025-01-10
  • Hans-Joachim Kaps

    For another project i need to know if and where a LCD ist connected. So, i wrote this little program.
    Works nice, but while playing around i find one curious thing.
    By mistake i commented the #include <lowlevel\lcd.h> line off. But Compiling was done without error.
    Until now i thought that this include is a MUST. Isn't it?</lowlevel\lcd.h>

     
  • Anobium

    Anobium - 2025-01-10

    Thank you!

    Nice addition!


    Any of the following lowlevel\files are now loaded automatically. Now, the compile does not use the contents of one these files until you make a call to something in a specific file. That way the code is still very small.

    LOWLEVEL.DAT

    'List of files in lowlevel\ to include by default
    picas.h
    a-d.h
    pwm.h
    rs232.h
    eeprom.h
    sound.h
    stdbasic.h
    7segment.h
    lcd.h
    ps2.h
    timer.h
    system.h
    hwspi.h
    keypad.h
    random.h
    string.h
    usart.h
    i2c.h
    hwi2c.h
    hwi2c2.h
    pwm16.h
    saf.h
    hef.h
    spisram.h
    

    The updated compiler report now shows the number of subs/functions/macros available to a specific program. In your example the total number of subs/functions/macro is 481 but you only use 20 system and 4 that you wrote.

    GCBASIC (2025.01.10 (Windows 64 bit) : Build 1450)
    
    Compiling: Lets find the LCD.gcb
    Program compiled successfully (Compile time: 0.772 seconds)
    
    Summary:
         Compiled:
              Program lines: 2042
              Subroutines:  User: 4 ; System: 20 of 481 ; Total: 24
         Chip resource usage:
              Program Memory: 720/32768 words (2.2%)
              RAM: 32/4096 bytes (.78%)
              OSC: HFINT32, 16Mhz (Internal oscillator)
    
    Assembling program using GCASM
    Program assembled successfully (Assembly time: 0.050 seconds)
    Done
    

    Things are slightly different for GLCD.H... but the same general rule applies to minimise the number of library files compiled.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.