Próbuję długo bezskutecznie skompilować ten plik:
no i tyle sobie mogę pooglądać na konsoli
14:53:48 **** Incremental Build of configuration Release for project wyswietlacz_graficzny ****
make all
'Building file: ../main.c'
'Invoking: AVR Compiler'
avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega644p -DF_CPU=1000000UL -MMD -MP -MF"main.d" -MT"main.o" -c -o "main.o" "../main.c"
'Finished building: ../main.c'
' '
'Building file: ../ssd1306.c'
'Invoking: AVR Compiler'
avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega644p -DF_CPU=1000000UL -MMD -MP -MF"ssd1306.d" -MT"ssd1306.o" -c -o "ssd1306.o" "../ssd1306.c"
'Finished building: ../ssd1306.c'
' '
'Building target: wyswietlacz_graficzny.elf'
'Invoking: AVR C Linker'
avr-gcc -Wl,-Map,wyswietlacz_graficzny.map -mmcu=atmega644p -o "wyswietlacz_graficzny.elf" ./main.o ./ssd1306.o
avr-gcc: error: ./main.o: No such file or directory
avr-gcc: error: ./ssd1306.o: No such file or directory
make: *** [wyswietlacz_graficzny.elf] Błąd 1
"make all" terminated with exit code 2. Build might be incomplete.
14:53:49 Build Finished. 0 errors, 0 warnings. (took 664ms)
Dodano po 3 [godziny] 17 [minuty]:
18:11:15 **** Incremental Build of configuration Release for project wyswietlacz_graficzny ****
make all
'Invoking: Print Size'
avr-size --format=avr --mcu=atmega644p wyswietlacz_graficzny.elf
AVR Memory Usage
----------------
Device: atmega644p
Program: 442 bytes (0.7% Full)
(.text + .data + .bootloader)
Data: 1024 bytes (25.0% Full)
(.data + .bss + .noinit)
'Finished building: sizedummy'
' '
18:11:15 Build Finished. 0 errors, 0 warnings. (took 192ms)
Dodano po 1 [minuty]:
Teraz zaczęło się kompilować
Nwm dlaczego
#include <avr/io.h> //dodanie głównej biblioteki
#include <util/delay.h> //dodanie biblioteki opóźniej
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <string.h>
#include <stdlib.h>
#include "ssd1306.h"
int main (void){
init();
while(1){
}
}
#include <avr/io.h> //dodanie głównej biblioteki
#include <util/delay.h> //dodanie biblioteki opóźniej
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <string.h>
#include <stdlib.h>
#include "ssd1306.h"
uint8_t buf[1024];
inline void wr_spi_bit(uint8_t a){
sck_0;
if(a)sda_1;
else sda_0;
sck_1;
}
void sbyte(uint8_t a){
uint8_t b = 1 << 7;
while(b){
wr_spi_bit(a & b);
b>>=1;
}
}
void cmd(uint8_t a){
dc_0;
sbyte(a);
}
void data(uint8_t a){
dc_1;
sbyte(a);
}
void turn_off_reset(void){
_delay_us(3);
res_1;
_delay_ms(100);
}
void wr_buf(void){
uint16_t a = 0;
dc_1;
while(a < 1024){
sbyte(buf[a]);
buf[a] = 0;
a++;
}
}
inline void init_spi(void){
sck_ddr|=sck;
sda_ddr|=sda;
}
void init(void){
init_spi();
res_ddr|=res;
dc_ddr|=dc;
turn_off_reset();
cs_ddr|=cs;
select_ssd1306;
cmd(Set_Multiplex_Ratio);
sbyte(mulitplex_ratio);
sbyte(Set_Display_Offset);
sbyte(Display_Offset);
sbyte(Set_Display_Start_Line | Display_Start_Line);
sbyte(Set_Segment_Re_map | Segment_Re_map);
sbyte(Set_COM_Output_Scan_Direction | COM_Output_Scan_Direction);
sbyte(Set_COM_Pins_Hardware_Configuration);
sbyte(COM_Pins_Hardware_Configuration);
sbyte(Set_Contrast_Control);
sbyte(Contrast);
sbyte(Entire_Display_ON | Display_ON);
sbyte(Set_Normal_Inverse_Display | Normal_Display);
sbyte(Set_Display_Clock_Divide_Ratio_Oscillator_Frequency);
sbyte(FOSC | divide_ratio);
sbyte(Charge_Pump_Setting);
sbyte(Enable_Pump);
sbyte(Set_Display_ON);
sbyte(Deactivate_scroll);
sbyte(Set_Memory_Addressing_Mode);
sbyte(Horizontal_Addressing_Mode);
buf[0] = (1 << 7)|(1 << 0);
buf[1] = (1 << 7)|(0 << 0);
buf[2] = (0 << 7)|(1 << 0);
buf[512] = 255;
buf[1023] = 1;
wr_buf();
}
/*
* ssd1306.h
*
* Created on: 5 maj 2024
* Author: Dzieci
*/
#ifndef SSD1306_H_
#define SSD1306_H_
#define pin_sck 0
#define sck (1<<pin_sck)
#define pin_sda 1
#define sda (1<<pin_sda)
#define pin_res 2
#define res (1<<pin_res)
#define pin_dc 3
#define dc (1<<pin_dc)
#define pin_cs 4
#define cs (1<<pin_cs)
#define sck_terminal D
#define sda_terminal D
#define res_terminal D
#define dc_terminal D
#define cs_terminal D
#define gowno(x, y) x ## y
#define fun(x, y) gowno(x, y)
#define sck_port fun(PORT, sck_terminal)
#define sck_ddr fun(DDR, sck_terminal)
#define sda_port fun(PORT, sda_terminal)
#define sda_ddr fun(DDR, sda_terminal)
#define res_port fun(PORT, res_terminal)
#define res_ddr fun(DDR, res_terminal)
#define dc_port fun(PORT, dc_terminal)
#define dc_ddr fun(DDR, dc_terminal)
#define cs_port fun(PORT, cs_terminal)
#define cs_ddr fun(DDR, cs_terminal)
#define sck_0 sck_port&=~sck
#define sck_1 sck_port|=sck
#define sda_0 sda_port&=~sda
#define sda_1 sda_port|=sda
#define res_0 res_port&=~res
#define res_1 res_port|=res
#define dc_0 dc_port&=~dc
#define dc_1 dc_port|=dc
#define select_ssd1306 cs_port&=~cs
#define deselect_ssd1306 cs_port|=cs
#define WIDTH 128
#define HEIGHT 64
#define Set_Multiplex_Ratio 0xA8
#define mulitplex_ratio 63
#define Set_Display_Offset 0xD3
#define Display_Offset 0
#define Set_Display_Start_Line 0x40
#define Display_Start_Line 0
#define Set_Segment_Re_map 0xA0
#define Segment_Re_map 0
#define Set_COM_Output_Scan_Direction 0xC0
#define COM_Output_Scan_Direction (0 << 3)
#define Set_COM_Pins_Hardware_Configuration 0xDA
#define COM_Pins_Hardware_Configuration ((0 << 5) | (1 << 4) | (1 << 1))
#define Set_Contrast_Control 0x81
#define Contrast 128
#define Entire_Display_ON 0xA4
#define Display_ON 0 //to sprawdzic
#define Set_Normal_Inverse_Display 0xA6
#define Normal_Display 0
#define Inverse_Display 1
#define Set_Display_Clock_Divide_Ratio_Oscillator_Frequency 0xD5
#define divide_ratio (0)
#define FOSC (0b1000 << 4) //moze to potem zwiekszyc
#define Charge_Pump_Setting 0x8D
#define Enable_Pump (1 << 2)
#define Disable_Pump (0 << 2)
#define Set_Display_ON 0xAF
#define Set_Display_OFF 0xAE
#define Deactivate_scroll 0x2E
#define Set_Memory_Addressing_Mode 0x20
#define Horizontal_Addressing_Mode 0b00
void init(void);
void wr_buf(void);
int main (void);
#endif /* SSD1306_H_ */
no i tyle sobie mogę pooglądać na konsoli
14:53:48 **** Incremental Build of configuration Release for project wyswietlacz_graficzny ****
make all
'Building file: ../main.c'
'Invoking: AVR Compiler'
avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega644p -DF_CPU=1000000UL -MMD -MP -MF"main.d" -MT"main.o" -c -o "main.o" "../main.c"
'Finished building: ../main.c'
' '
'Building file: ../ssd1306.c'
'Invoking: AVR Compiler'
avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega644p -DF_CPU=1000000UL -MMD -MP -MF"ssd1306.d" -MT"ssd1306.o" -c -o "ssd1306.o" "../ssd1306.c"
'Finished building: ../ssd1306.c'
' '
'Building target: wyswietlacz_graficzny.elf'
'Invoking: AVR C Linker'
avr-gcc -Wl,-Map,wyswietlacz_graficzny.map -mmcu=atmega644p -o "wyswietlacz_graficzny.elf" ./main.o ./ssd1306.o
avr-gcc: error: ./main.o: No such file or directory
avr-gcc: error: ./ssd1306.o: No such file or directory
make: *** [wyswietlacz_graficzny.elf] Błąd 1
"make all" terminated with exit code 2. Build might be incomplete.
14:53:49 Build Finished. 0 errors, 0 warnings. (took 664ms)
Dodano po 3 [godziny] 17 [minuty]:
18:11:15 **** Incremental Build of configuration Release for project wyswietlacz_graficzny ****
make all
'Invoking: Print Size'
avr-size --format=avr --mcu=atmega644p wyswietlacz_graficzny.elf
AVR Memory Usage
----------------
Device: atmega644p
Program: 442 bytes (0.7% Full)
(.text + .data + .bootloader)
Data: 1024 bytes (25.0% Full)
(.data + .bss + .noinit)
'Finished building: sizedummy'
' '
18:11:15 Build Finished. 0 errors, 0 warnings. (took 192ms)
Dodano po 1 [minuty]:
Teraz zaczęło się kompilować
Nwm dlaczego