AVRGCC a texty

Milan milger@pobox.sk
Pátek Srpen 20 13:31:00 CEST 2004


1/ Mam otazku:
    Ako to skonci pri pokuse s:
       void Outtext(const char  __attribute__((progmem)) *text)
2/ Co tak skusit najobecnejsi tvar a nechat to na kompilator ako si poradi:

       void Outtext(char *text)

Milan

----- Original Message ----- 
From: "Kovar Milan" <mkovar@seznam.cz>
To: "[HWnews]" <hw-list@mailman.nethouse.cz>
Sent: Friday, August 20, 2004 12:52 PM
Subject: Re: AVRGCC a texty


> > Problem je v tom, ze neposlete ani kousek Vasi rutinky :-)))
>
> Cely testovaci programek posilam.
> At pouzije jeden, nebo druhy tvar deklarace, vzdy se vypisuje jen text,
> ktery je primo v parametru, ovsem ten se kopiruje do RAM. Text z
> konstanty se nevypisuje.
> Pouzivam AvrEdit V3.5
>
>
> #include <stdlib.h>
> #include <stdio.h>
> #include <string.h>
> #include <io.h>
> #include <interrupt.h>
> #include <sig-avr.h>
> #include <pgmspace.h>
>
> const unsigned char __attribute__((progmem)) text1[]="Ahoj";
>
>
> void UART_transmit(unsigned char data)
>      {
>      while (!(UCSRA&(1<<UDRE)));
>      UDR=data;
>      }
>
> void Outtext(const char * __attribute__((progmem)) text)
> /*void Outtext(const char *text)*/    {
>      while(*text)
>          {
>          UART_transmit(*text++);
>          }
>      }
>
> int main(void)
>      {
>      UBRRH=0x00;
>      UBRRL=0x33;
>      UCSRB=(1<<RXCIE)|(1<<RXEN)|(1<<TXEN);
>      UCSRC=(1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0);
>      do
>        {
>          Outtext(text1);
>          Outtext("text1");
>        }
>      while (1);
>      }
>
>
>
>
> __________ Informacia od NOD32 1.847 (20040818) __________
>
> Tato sprava bola preverena antivirusovym systemom NOD32.
> http://www.eset.sk
>
>


----------------------------------------------------------------------------
----


_______________________________________________
HW-list mailing list  -  sponsored by www.HW.cz
HW-list@mailman.nethouse.cz
http://mailman.nethouse.cz/mailman/listinfo/hw-list


__________ Informacia od NOD32 1.847 (20040818) __________

Tato sprava bola preverena antivirusovym systemom NOD32.
http://www.eset.sk





Další informace o konferenci Hw-list