nopnop2002 / esp-idf-parallel-tft

8bit parallel TFT & 4-line resistance touch screen Driver for esp-idf using i2s paralell mode
MIT License
106 stars 26 forks source link

Added typedef for font direction as we can enter any value having just #29

Open SyncRone157 opened 1 year ago

SyncRone157 commented 1 year ago

Added typedef for font direction as we can enter any value having just 4 directions. Entering wrong value we won't get error and won't see text on the display. Adding typedef enum fixes it.

nopnop2002 commented 1 year ago

No error in my environment.

I want to see your log when compiling.

There is probably some other cause.

$ idf.py build
Executing action: all (aliases: build)
Running ninja in directory /home/nop/rtos/esp-idf-parallel-tft/build
Executing "ninja all"...
[1/7] cd /home/nop/rtos/esp-idf-parall...df-parallel-tft/build/parallel-tft.binparallel-tft.bin binary size 0x3d7a0 bytes. Smallest app partition is 0x100000 bytes. 0xc2860 bytes (76%) free.
[1/1] cd /home/nop/rtos/esp-idf-parall...el-tft/build/bootloader/bootloader.binBootloader binary size 0x6700 bytes. 0x900 bytes (8%) free.

Project build complete. To flash, run this command:
/home/nop/.espressif/python_env/idf5.0_py3.8_env/bin/python ../../esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32  write_flash --flash_mode dio --flash_size 2MB --flash_freq 40m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/parallel-tft.bin 0x110000 build/storage0.bin 0x130000 build/storage1.bin 0x140000 build/storage2.bin
or run 'idf.py -p (PORT) flash'
SyncRone157 commented 1 year ago

Yes it is no error, but try to enter the direction for example x >=4 and you will see the result. You won't get any errors and there won't be text on the display. That what I ment. Adding typedef enum allows to get a message during compilation.

nopnop2002 commented 1 year ago

I understood your intention.


With ESP-IDF V5.1, ADC-related libraries have been destructively changed. We will address this in the near future. I will consider your PR at that time. Until then, this PR will remain active.

SyncRone157 commented 1 year ago

@nopnop2002 it is not related to ADC, it is type checking allowing to pass into lcdFontSetDirection() value just within the range 0-3, and in case someone tries to pass some other int they will see error during compilation. There is in PR also some cosmetic changes replacing "magic" numbers of direction like 0,1,2,3 to enums.

nopnop2002 commented 1 year ago

it is not related to ADC

I know.