Diff for /gforth/engine/io-nxt.c between versions 1.2 and 1.3

version 1.2, 2007/04/22 20:06:26 version 1.3, 2007/04/22 20:51:55
Line 25 Line 25
 #include "forth.h"  #include "forth.h"
 #include "../arch/arm/nxt/AT91SAM7.h"  #include "../arch/arm/nxt/AT91SAM7.h"
 #include "../arch/arm/nxt/bt.h"  #include "../arch/arm/nxt/bt.h"
   #include "../arch/arm/nxt/display.h"
   #include "../arch/arm/nxt/aic.h"
   #include "../arch/arm/nxt/systick.h"
   #include "../arch/arm/nxt/sound.h"
   #include "../arch/arm/nxt/interrupts.h"
   #include "../arch/arm/nxt/nxt_avr.h"
   #include "../arch/arm/nxt/nxt_motors.h"
   #include "../arch/arm/nxt/i2c.h"
   
 long key_avail ()  int terminal_prepped = 0;
 {  
   return bt_avail();  
 }  
   
 Cell getkey()  void
   show_splash(U32 milliseconds)
 {  {
   return bt_getkey();    display_clear(0);
 }    display_goto_xy(6, 6);
     display_string("Gforth");
     display_update();
   
 int terminal_prepped = 0;    systick_wait_ms(milliseconds);
   }
   
 void prep_terminal ()  void prep_terminal ()
 {  {
   aic_initialise();    aic_initialise();
   interrupts_enable();    interrupts_enable();
   systick_init();    systick_init();
     sound_init();
     nxt_avr_init();
   display_init();    display_init();
     nxt_motor_init();
     i2c_init();
   bt_init();    bt_init();
     display_goto_xy(0,0);
     display_clear(1);
   
   terminal_prepped = 1;    terminal_prepped = 1;
 }  }
Line 54  void deprep_terminal () Line 69  void deprep_terminal ()
   terminal_prepped = 0;    terminal_prepped = 0;
 }  }
   
   long key_avail ()
   {
     if(!terminal_prepped) prep_terminal();
     return bt_avail();
   }
   
   Cell getkey()
   {
     if(!terminal_prepped) prep_terminal();
     return bt_getkey();
   }
   
 void emit_char(char x)  void emit_char(char x)
 {  {
   bt_send(&x, 1);    if(!terminal_prepped) prep_terminal();
   display_char(x);    display_char(x);
     display_update();
     bt_send(&x, 1);
 }  }
   
 void type_chars(char *addr, unsigned int l)  void type_chars(char *addr, unsigned int l)
 {  {
   int i;    int i;
   bt_send(addr, l);  
   for(i=0; i<l; i++)    for(i=0; i<l; i++)
     display_char(addr[i]);      emit_char(addr[i]);
 }  }

Removed from v.1.2  
changed lines
  Added in v.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>