GCC i printf

Loading thread data ...

Zainicjowales UART?? Predkosc, z przerwaniami lub bez, ile bitow transmisji???

Reply to
invalid unparseable

a zrob tak: fclose(stdout); stdout = 0; uartInit(); // initialize uart fdevopen (uart_putchar, NULL, 0);

P.S. Uzywasz stdio do LCD?

Reply to
invalid unparseable

Wed, 28 Jul 2004 15:39:23 +0200, na pl.misc.elektronika, Mister napisał(a):

Czy przypadkiem fdevopen to nie jest 'wynalazek' specjalnie pod avr ?

[..] The standard streams stdin, stdout, and stderr are provided, but contrary to the C standard, since avr-libc has no knowledge about applicable devices, these streams are not already pre-initialized at application startup. Also, since there is no notion of "file" whatsoever to avr-libc, there is no function fopen() that could be used to associate a stream to some device. (See note 1.) Instead, the function fdevopen() is provided to associate a stream to a device, where the device needs to provide a function to send a character, to receive a character, or both. [..]
Reply to
Jurek Szczesiul

Mister napisal(a):

Ja tam bym sie nie chrzanil, tylko uzyl sprintfa ;--).

Reply to
Marcin E. Hamerla

Mister <wojpie@wywal_to.poczta.onet.pl> napisał:

To czego szukasz nazywa sie freopen - cytat z mana: Funkcja freopen otwiera plik, którego nazwę wskazuje path i związuje z nim strumień wskazywany przez stream. Strumień ten jest zamykany (jeśli istnieje). Atrybut mode ma takie samo znaczenie jak w przypadku funkcji fopen. Głównym zastosowaniem funkcji freopen jest zamiana pliku związanego ze standartowymi strumieniem tekstowym (stderr, stdin lub stdout). GRG

Reply to
Grzegorz Domagala

Mister snipped-for-privacy@poczta.onet.pl> napisał:

:)))) "man freopen" jesli masz linuksa :). Lub google "freopen" - na pewno cos znajdzie. Na przyszlosc - man nazwa_funkcji bedzie pomocne przypadku 99% funkcji z biblioteki standardowej. GRG

Reply to
Grzegorz Domagala

Mozesz powiedziec jaka sciezka (path) wskazuje na port szeregowy?

Krzysiek Rudnik

Reply to
Krzysztof Rudnik
Reply to
invalid unparseable

A jakiej używasz bibliteki standartowej? Newlib? Jeśli tak, to chyba musisz zaimplementować funkcję outbyte (oraz ewentualnie inbyte - do czytania) i zlinkować ją z Twoim softem. AFAIR w źródłach newlib są przykładawe implementacje dla jakiejś kości z rodziny m68k.

BTW. To nie jest problem kompilatora tylko biblioteki standartowej - wbrew pozorom to są dwie różne rzeczy.

Regards, /J.D.

Reply to
Jan Dubiec

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.