Cześć, piszę kod na mikokontrolera Atmega8A i w 57 linii dostaję taki błąd
called object "8" is not a function
O co to chodzi skoro tam nie ma żadnej funkcji? Dlaczego kompilator podaje mi jakąś liczbę 8? Jak mam naprawić ten błąd?
#include <avr/io.h>
#include <avr/interrupt.h>
#include <hd44780.c>
#include <stdio.h>
#include <stdlib.h>
volatile int seconds = 0;
volatile int minutes = 0;
volatile int hours = 0;
char secondsBuffer[3];
char minutesBuffer[3];
char hoursBuffer[3];
ISR(TIMER1_COMPA_vect)
{
seconds++;
if(seconds == 60)
{
seconds = 0;
minutes ++;
if(minutes == 60)
{
seconds = 0;
minutes = 0;
hours ++;
if(hours == 24)
{
hours, minutes, seconds = 0;
}
}
}
}
ISR(INT0_vect)
{
if(!(PIND & (1 << PD2)))
{
minutes++;
}
}
ISR(INT1_vect)
{
if(!(PIND & (1 << PD3)))
{
}
}
int main(void)
{
DDRD &= ~(1 << PD2);
DDRD &= ~(1 << PD3)
DDRB &= ~(1 << PB6);
PORTD |= (1 << PD2);
PORTD |= (1 << PD3);
PORTB |= (1 << PB6);
// LCD init
LCD_Initalize();
// Timer init
TCCR1B |= (1 << WGM12);
OCR1A = 977;
TIMSK |= (1 << OCIE1A);
TCCR1B |= (1 << CS12) | (1 << CS10);
GICR |= (1 << INT1) | (1 << INT0);
MCUCR |= (1 << ISC10); // For INT1
MCUCR |= (1 << ISC00); // For in INT0
sei();
while(1)
{
itoa(seconds, secondsBuffer, 10);
itoa(minutes, minutesBuffer, 10);
itoa(hours, hoursBuffer, 10);
LCD_Clear();
LCD_GoTo(0, 0);
LCD_WriteText("Aktualna godzina");
LCD_GoTo(4, 1);
if(hours == 0)
{
LCD_WriteText("00");
}
else
{
LCD_WriteText(hoursBuffer);
}
LCD_GoTo(6, 1);
LCD_WriteText(":");
LCD_GoTo(7, 1);
if(minutes == 0)
{
LCD_WriteText("00");
}
else
{
LCD_WriteText(minutesBuffer);
}
LCD_GoTo(9, 1);
LCD_WriteText(":");
LCD_GoTo(10, 1);
if(seconds == 0)
{
LCD_WriteText("00");
}
else
{
LCD_WriteText(secondsBuffer);
}
_delay_ms(500);
}
return 0;
}