Subversion Repositories HomeAutomation

Rev

Blame | Last modification | View Log | SVN | RSS feed

  1. #include <inttypes.h>
  2. #include <bios.h>
  3.  
  4. static int app_putchar(char c, FILE *stream);
  5. static int app_getchar(FILE *stream);
  6.  
  7. static FILE mystdio = FDEV_SETUP_STREAM(app_putchar, app_getchar,
  8.                                          _FDEV_SETUP_RW);
  9.  
  10. static int app_putchar(char c, FILE *stream) {
  11.     return bios->put_char(c, stream);
  12. }
  13.    
  14. static int app_getchar(FILE *stream) {
  15.     return bios->get_char(stream);
  16. }
  17.  
  18. int main(void)
  19. {
  20.     unsigned ver;
  21.     ver = bios->version();
  22.    
  23.     stdout = &mystdio;
  24.     stdin = &mystdio;
  25.    
  26.     printf("AVR Test Application\n");
  27.     printf("Using AVR BIOS version %x\n", ver);
  28.    
  29.     return ver;
  30. }
  31.