Forum: Compiler & IDEs Attiny2313 + lcd


von Anlen (Gast)


Angehängte Dateien:

Lesenswert?

Hallo,

ich versuche gerade folgende Code zu erstellen.
Ich benutze folgende WinAvr Version 20070525.

Meine C-Kenntnisse sind leider mangelhaft.

In der Hauptdatei habe ich folgende Fehlermeldungen:

implicit declaration of function 'timer_enabled_int'
und
implicit declaration of function 'PRG_RDB'

meine Kennstnisse sagen mir das beide Funktionen nicht vorhanden sind.
Ist das richtig?

Hier zum ersten Fehler ein Auszug:
1
void ioinit (void) /* Initialize PWM timers*/
2
{
3
4
  /* Initialize backlight PWM */
5
  
6
   /* led timer (timer1) is 10-bit PWM */
7
    TCCR1A = _BV (WGM10) | _BV (WGM11) | _BV (COM1A1);
8
  
9
  /* led timer (timer1) ckdiv = 8 */
10
    TCCR1B = _BV (CS11);
11
  
12
  /* set PWM value to 0 */
13
    OCR_led = 0;
14
  
15
  /* enable PB3 as led output */
16
    DDRB |= _BV (OC_led);
17
  
18
  /* backlight PWM initialized */
19
  
20
  /* initialize contrast PWM */
21
  
22
  /* Contrast timer (timer 0) is 8-bit pwm */
23
  TCCR0A = _BV (WGM00) | _BV (WGM01) | _BV (COM0A1);
24
  
25
  /* Contrast timer (timer 0)  ckdiv = 64 */
26
    TCCR0B = (_BV (CS01) | _BV (CS00));
27
  
28
  /* set PWM value to 0 */
29
    OCR_contrast = 0;
30
  
31
  /* enable PB2 as contrast output */
32
    DDRB |= _BV (OC_contrast);
33
  
34
  /* Enable timer0 and timer1 interrupts */
35
  //****************************************************
36
  timer_enable_int (_BV (TOIE1) | _BV (TOIE0));
37
  //TIMSK = (_BV (TOIE1) | _BV (TOIE0));
38
  
39
  /* now enable interrupts */
40
  sei();
41
}
und hier ensteht der zweite Fehler:
in der while Schleife
1
  if ( c & 0xff00 )
2
    {
3
      lcd_puts_P("UART ERROR ");
4
      lcd_putc(PRG_RDB(&hexdigits[c >> 12]));
5
      lcd_putc(PRG_RDB(&hexdigits[(c >> 8) & 0x0f]));
6
      lcd_putc('\n');
7
      c &= 0xff; /* Strip of the error bits, and continue handling. */
8
    }

Kann mir jemand weiterhelfen, danke im vorraus.
Gruß anlen

von Anlen (Gast)


Lesenswert?

Hallo,

das mit dem PRG_RDB habe ich hinbekommen, muss durch pgm_read_byte 
ersetzt werden.

Anlen

von Jörg X. (Gast)


Lesenswert?

"timer_enable_int " scheint ein Name für das TIMSK-Register zu sein (da 
sind die TOIEn drin), also erstmal mit TIMSK ersetzen

hth. Jörg

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.