[En-Nut-Discussion] printf/putf %S for string in flash?

Ralph Mason ralph.mason at telogis.com
Fri Oct 17 06:45:58 CEST 2003


And I have added support for %P (program chars).  Limitation's : None :-)

        case 'P':  //Program Chars
        
             cp = va_arg(ap, char *);
             xdigs = buf;
             n=0;

             while(1){
				u_char ch = PRG_RDB(cp++);
				if ( !ch ) break;
				*xdigs++ = ch;
				n++;
				
				if ( n == BUF ){
 					_putb(fd, buf, n);
 					n=0;
 					xdigs = buf;
 				}
             }
             _putb(fd, buf, n);
             size=0;
             sign=0;
             break;

I doubt either will we added.

Ralph


> -----Original Message-----
> From: en-nut-discussion-admin at egnite.de
> [mailto:en-nut-discussion-admin at egnite.de]On Behalf Of Damian Slee
> Sent: Friday, 17 October 2003 5:11
> To: en-nut-discussion at egnite.de
> Subject: [En-Nut-Discussion] printf/putf %S for string in flash?
> 
> 
> Hi,
> I have added support for '%S', strings from FLASH to my 
> crt\putf.c.  Should this be added to sourceforge?
> 
> Limitation is that it uses buf[BUF] to copy the string to memory. 
>  Which is maximum 16 bytes, or 15 characters.
> 
> 
> ...
> 
> 	case 'S':
>             cp = va_arg(ap, char *);
>             if (cp == 0)
>                 goto putf_s;
>             memcpy_P(buf,cp, BUF);   /* only support upto max 
> size of buf */
>             buf[BUF-1] = 0;          /* nul terminate if string 
> was longer */
>             cp = buf;
>             goto putf_s;
> 
>         case 's':
>             cp = va_arg(ap, char *);
> putf_s:
> 
> ...
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.516 / Virus Database: 313 - Release Date: 1/09/2003
> 



More information about the En-Nut-Discussion mailing list