2 * Copyright (C) 2004,2008 Kustaa Nyholm
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifdef CONFIG_CARL9170FW_PRINTF
25 static unsigned int num;
29 static void out(const char c)
34 static void outDgt(const char dgt)
36 out(dgt + (dgt < 10 ? '0' : (uc ? 'A' : 'a') - 10));
40 static void divOut(const unsigned int d)
42 unsigned char dgt = 0;
53 void tfp_printf(const char *fmt, ...)
62 while ((ch = *(fmt++))) {
75 if (ch >= '0' && ch <= '9') {
77 while (ch >= '0' && ch <= '9') {
78 w = (((w << 2) + w) << 1) + ch - '0';
93 num = va_arg(va, unsigned int);
94 if (ch == 'd' && (int) num < 0) {
99 for (i = 100000000; i != 1; i /= 10)
109 num = va_arg(va, unsigned int);
110 for (i = 0x10000000; i != 0x1; i >>= 4)
117 out((char)(va_arg(va, int)));
121 p = va_arg(va, char*);
133 while (*bf++ && w > 0)
137 putcharacter(lz ? '0' : ' ');
151 void min_printf(const char *fmt, ...)
161 #endif /* CONFIG_CARL9170FW_PRINTF */