[elektro] avr-gcc

zulu zulu at gportal.hu
Sat Aug 2 12:37:54 CEST 2008


No ez müxik, tanulságos, de még tesztelni kell:
/////////////////////////////////////////////////////////////////////////
#include "avr/pgmspace.h"
#include "avr/interrupt.h"
#include "uart.h"

#define UART_BAUD_RATE  9600

const char menu[] PROGMEM = "Main menu";
PGM_P   pnt[] = { menu };

int main ( void )
{
char puffer[ sizeof( menu ) ];

     uart_init( UART_BAUD_SELECT( UART_BAUD_RATE, F_CPU ) );
     sei();
     strcpy_P( puffer, pnt[ 0 ] );
     uart_puts( puffer );
}
/////////////////////////////////////////////////////////////////////////

zulu írta:
> Hi All!
> 
> Kérek 1 kis segítséget. Mi a baj ezzel a programmal:
> /////////////////////////////////////////////////////////////////////////
> #include "stdlib.h"
> #include <avr/pgmspace.h>
> #include "avr/io.h"
> #include "avr/interrupt.h"
> #include "uart.h"
> 
> #define UART_BAUD_RATE  9600
> 
> const char menu[] PROGMEM = "Main menu";
> 
> int main ( void )
> {
>      uart_init( UART_BAUD_SELECT( UART_BAUD_RATE, F_CPU ) );
>      sei();
>      uart_puts_P( menu );
> }
> /////////////////////////////////////////////////////////////////////////



More information about the Elektro mailing list