Hello All,
After repairing my AY-AT tester and properly flashing the compiled code to the Atmega328P, I want now to change some settings, so I have to compile the code myself.
I used the 1.39m version,
set up everything according to the clones document, installed avr-gcc but I have one compilation error. Did I do something wrong ?
avr-gcc -mmcu=atmega328 -Wall -mcall-prologues -I. -Ibitmaps -DF_CPU=16000000UL -DOSC_STARTUP=16384 -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT display.o -MF dep/display.o.d -c display.c
display.c: In function 'Display_HexByte':
display.c:403:3: warning: implicit declaration of function 'Display_HexDigit'; did you mean 'Display_HexByte'? [-Wimplicit-function-declaration]
403 | Display_HexDigit(Digit);
| ^~~~~~~~~~~~~~~~
| Display_HexByte
avr-gcc -mmcu=atmega328 -Wl,-Map=ComponentTester.map main.o user.o pause.o adjust.o ADC.o probes.o display.o resistor.o cap.o semi.o inductor.o tools_misc.o tools_signal.o SPI.o I2C.o serial.o commands.o OneWire.o IR_RX.o IR_TX.o DHTxx.o HD44780.o ST7565R.o ILI9341.o PCD8544.o ST7735.o ST7920.o SSD1306.o ILI9163.o STE2007.o PCF8814.o ST7036.o VT100.o ADS7843.o wait.o -o ComponentTester
/usr/local/opt/avr-binutils/bin/avr-ld: display.o: in function `Display_HexByte':
/Volumes/DATA/FIRMWARE/ComponentTester-1.39m/display.c:403: undefined reference to `Display_HexDigit'
/usr/local/opt/avr-binutils/bin/avr-ld: /Volumes/DATA/FIRMWARE/ComponentTester-1.39m/display.c:407: undefined reference to `Display_HexDigit'
collect2: error: ld returned 1 exit status
make: *** [ComponentTester] Error 1
I set up the ST7735 SPI interface as
/*
* ST7735, SPI interface (bit-bang, 4 wire)
*/
#if 1
#define LCD_ST7735 /* display controller ST7735 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_COLOR /* color display */
#define LCD_SPI /* SPI interface */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RES PD4 /* port pin used for /RESX (optional) */
#define LCD_CS PD5 /* port pin used for /CSX (optional) */
#define LCD_DC PD3 /* port pin used for D/CX */
#define LCD_SCL PD2 /* port pin used for SCL */
#define LCD_SDA PD1 /* port pin used for SDA */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 160 /* number of vertical dots */
//#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
#define LCD_ROTATE /* switch X and Y (rotate by 90∞) */
//#define LCD_OFFSET_X 4 /* enable x offset of 2 or 4 dots */
//#define LCD_OFFSET_Y 2 /* enable y offset of 1 or 2 dots */
#define LCD_LATE_ON /* turn on LCD after clearing it */
/* font and symbols: horizontally aligned & flipped */
#define FONT_10X16_HF /* 10x16 font */
//#define FONT_10X16_ISO8859_2_HF /* 10x16 Central European font */
//#define FONT_8X16_WIN1251_HF /* 8x16 cyrillic font */
#define SYMBOLS_30X32_HF /* 30x32 symbols */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCL /* port pin used for SCK */
#define SPI_MOSI LCD_SDA /* port pin used for MOSI */
#endif