Beispiel #1
0
void disp_scan(void)
{
    static xd_u8 cnt = 0;
    xd_u8 temp;
    static bool flash;

    custom_buf_update();

#if 0
	init_disp_buf();
	disp_putchar('0',0);
	disp_putchar('1',1);
	disp_putchar('2',2);
	disp_putchar('3',3);
#endif	

    TRADEMARK_ICON |=TRADEMARK_MASK;

    lcd_flash_timer++;
    if (lcd_flash_timer == 220)
    {
        lcd_flash_timer = 0;
        flash = !flash;
    }
    if (flash)
    {
        disp_clr_icon(lcd_flash_icon);   
    }
    else
    {
        disp_icon(lcd_flash_icon); 
    }

    temp = cnt>>1;
    close_com(temp);
    if(cnt & 0x01){
	  seg07_port(lcd_buff[temp]);
	  seg8_port( ( ((lcd_buff[temp]&0x0100)>0)?1:0 ) );
	  seg9_port( ( ((lcd_buff[temp]&0x0200)>0)?1:0 ) );
	  clr_com(temp);
    }
    else
   {                            
	  seg07_port(~lcd_buff[temp]);
	  seg8_port(( ((lcd_buff[temp]&0x0100)>0)?0:1 ));
	  seg9_port(( ((lcd_buff[temp]&0x0200)>0)?0:1 ));
	  set_com(temp);
   }

   cnt++;
   if(cnt>7)cnt = 0;
}
Beispiel #2
0
void seg_lcd_disp_scan(void)
{
    static u8 cnt = 0;
    u8 temp;
    static bool flash;
    //seg_lcd_flash_icon(USB_ICON);

    lcd_flash_timer++;
    if (lcd_flash_timer == 220)
    {
        lcd_flash_timer = 0;
        flash = !flash;
    }
    if (flash)
    {
        seg_lcd_flash_section();   
    }
    else
    {
        seg_lcd_disp_icon(lcd_flash_icon); 
    }
	
    temp = cnt>>1;
    close_com(temp);
    if(cnt & 0x01){
	  seg07_port(lcd_buff[temp]);
	  seg8_port( ( ((lcd_buff[temp]&0x0100)>0)?1:0 ) );
	  clr_com(temp);
    }
    else
   {                            
	  seg07_port(~lcd_buff[temp]);
	  seg8_port(( ((lcd_buff[temp]&0x0100)>0)?0:1 ));
	  set_com(temp);
   }

	   cnt++;
  	if(cnt>7)cnt = 0;
}
Beispiel #3
0
void disp_scan(void)
{
    static xd_u8 cnt = 0;
    xd_u8 temp;
    static bool flash;

    custom_buf_update();

     lcd_flash_timer++;
    if (lcd_flash_timer == 220)
    {
        lcd_flash_timer = 0;
        flash = !flash;
    }
    if (flash)
    {
        disp_clr_icon(lcd_flash_icon);   
    }
    else
    {
        disp_icon(lcd_flash_icon); 
    }

    temp = cnt>>1;
    close_com(temp);
    if(cnt & 0x01){
	  seg07_port(lcd_buff[temp]);
	  clr_com(temp);
    }
    else
   {                            
	  seg07_port(~lcd_buff[temp]);
	  set_com(temp);
   }
	
   cnt++;
   if(cnt>9)cnt = 0;
}
Beispiel #4
0
main(int argc, char *argv[])
{
/*

   This is the main section of this driver. It's makeup is entirely
   up to you. With of course, several REQUIRED sets.

   */
int i,x,count;
int y=0,block_size=1024;
int send=0,do_acks=0;
char s[81],s1[81];
qvideo();
clrscrn();
Screen_ptr = malloc(1 * 4000);
if(Screen_ptr == NULL) exit(1);
uncomprs(&Screen_ptr[0*4000], tmod); /* uncompress screen 1 */
memtoscr(2000, 0, Screen_ptr);
curoff();
for(i=1;i<argc;i++)
 {
  if(argv[i][0] == '/' || argv[i][0] == '-')
  {
    switch(toupper(argv[i][1]))
    {
    case 'S' : block_size = atoi(argv[i+1]);
               if(block_size > 1024)
                             block_size = 1024;
               break;
    case 'A' : do_acks = 1;break;
    case 'K' : delete_aborted_transfers = 0;
               break;
    case 'P' : port_ptr = atoi(argv[i+1]);
               port_ptr--;
               break;
    case 'B' : connect_rate = atoi(argv[i+1]);
               cur_baud = connect_rate;
               block_size = (connect_rate > 2400) ? 2048 : 1024;
               break;
    case 'L' : locked_port = atol(argv[i+1]);
               break;
    case 'R' : set_com();

               /*
                 You should continue to cycle receiving files until
                 Zrecfile returns a ZERO, indicating that it did not
                 receive any files or the session was aborted.
                 */

               while ( Zrecfile(do_acks,block_size) && (async_carrier(port))) clear_screen() ;

               /* Following the last file, the sender will require an ACK
                  to signal the receivers acknowledges end of session.

                  The Sender doesn't respond back after receiving the ACK so
                  continue with you processing after sending a couple of
                  ACKS. Two is suggested, an extra incase line noise blew the
                  first one.
                  */

               com_putc(ACK);
               com_putc(ACK);
               end_prg();
               break;

    case 'F' : set_com();
               i++;
               for(;i<argc;i++)
                {
                 memset(s,'\0',sizeof(s));
                 parser(argv[i],&s[0]);

                 /* Cycle until all files are sent or Zsendfile returns
                    a zero indicating Session was aborted. */

                 if(!Zsendfile(argv[i],s))
                       end_prg();
                 if(!async_carrier(port)) end_prg();
                 clear_screen();
                }
                i = count = 0;

                /* Cycle sending EOT until receiver sees it and ACKs
                    the ending EOT. I suggest cycling only two periods
                    , period being defined as trying ACKEOT function twice. */

                while(!count && i <= 1)
                  {
                   com_putc(EOT);
                   i++;
                   if(ackeot()) count = 1;
                   if(!async_carrier(port)) count = 1;
                  }
                end_prg();
                break;
   }
 }
 }

}