aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/UC8173/UC8173_waveform_examples.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-11-03 10:51:23 +1000
committerinmarket <andrewh@inmarket.com.au>2018-11-03 10:51:23 +1000
commit7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d (patch)
tree95cf152ef65ff19c7b2515b427bbe86b92b611d0 /drivers/gdisp/UC8173/UC8173_waveform_examples.h
parent8bd70d953bcd3e32ceb4e45a4e561c973726280a (diff)
downloaduGFX-7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d.tar.gz
uGFX-7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d.tar.bz2
uGFX-7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d.zip
For all source files update integer types to the new gI8 etc type names
Diffstat (limited to 'drivers/gdisp/UC8173/UC8173_waveform_examples.h')
-rw-r--r--drivers/gdisp/UC8173/UC8173_waveform_examples.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gdisp/UC8173/UC8173_waveform_examples.h b/drivers/gdisp/UC8173/UC8173_waveform_examples.h
index e8ac919b..8bfaf93f 100644
--- a/drivers/gdisp/UC8173/UC8173_waveform_examples.h
+++ b/drivers/gdisp/UC8173/UC8173_waveform_examples.h
@@ -1,4 +1,4 @@
-static uint8_t const _lut_ft[] = {
+static gU8 const _lut_ft[] = {
0x55,0x55,0x55,0x55,0x55,0xAA,0xAA,0xAA,0xAA,0xAA,0x55,0x55,0x55,0x55,0x55,0x55,
0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5A,0x5A,
0x5A,0x5A,0x5A,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x5A,0x5A,
@@ -9,11 +9,11 @@ static uint8_t const _lut_ft[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8_t const _lut_KWvcom_DC_GU[] = {
+static gU8 const _lut_KWvcom_DC_GU[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8_t const _lut_kw_GU[] = {
+static gU8 const _lut_kw_GU[] = {
0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,
0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,
0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,
@@ -48,11 +48,11 @@ static uint8_t const _lut_kw_GU[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8_t const _lut_KWvcom_GC[] = {
+static gU8 const _lut_KWvcom_GC[] = {
0x55,0x6A,0xA5,0x55,0x55,0x55,0x55,0x55,0x56,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8_t const _lut_kw_GC[] = {
+static gU8 const _lut_kw_GC[] = {
0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81,
0x41,0x00,0x00,0x81,0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82,
0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82,0x42,0x00,0x00,0x41,0x42,0x00,0x00,0x41,
@@ -87,11 +87,11 @@ static uint8_t const _lut_kw_GC[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8_t const _lut_KWvcom_DC_A2_240ms[] = {
+static gU8 const _lut_KWvcom_DC_A2_240ms[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8_t const _lut_kw_A2_240ms[] = {
+static gU8 const _lut_kw_A2_240ms[] = {
0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,
0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,
0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,
@@ -126,11 +126,11 @@ static uint8_t const _lut_kw_A2_240ms[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8_t const _lut_KWvcom_DC_A2_120ms[] = {
+static gU8 const _lut_KWvcom_DC_A2_120ms[] = {
0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8_t const _lut_kw_A2_120ms[] = {
+static gU8 const _lut_kw_A2_120ms[] = {
0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,
0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,
0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,
e.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * This file is subject to the terms of the GFX License. If a copy of
 * the license was not distributed with this file, you can obtain one at:
 *
 *              http://ugfx.org/license.html
 */

/********************************************************
 * Printg Routines
 ********************************************************/

#include "../../gfx.h"

#if GFX_USE_GFILE && GFILE_NEED_PRINTG

#include <stdarg.h>

#define MAX_FILLER		11
#define FLOAT_PRECISION 100000

int fnprintg(GFILE *f, int maxlen, const char *fmt, ...) {
	int		res;
	va_list	ap;

	va_start(ap, fmt);
	res = vfnprintg(f, maxlen, fmt, ap);
	va_end(ap);
	return res;
}

static char *ltoa_wd(char *p, long num, unsigned radix, long divisor) {
	int		i;
	char *	q;

	if (!divisor) divisor = num;

	q = p + MAX_FILLER;
	do {
		i = (int)(num % radix);
		i += '0';
		if (i > '9')
		  i += 'A' - '0' - 10;
		*--q = i;
		num /= radix;
	} while ((divisor /= radix) != 0);

	i = (int)(p + MAX_FILLER - q);
	do {
		*p++ = *q++;
	} while (--i);

	return p;
}

int vfnprintg(GFILE *f, int maxlen, const char *fmt, va_list arg) {
	int		ret;
	char	*p, *s, c, filler;
	int		i, precision, width;
	bool_t	is_long, left_align;
	long	l;
	#if GFILE_ALLOW_FLOATS
		float	fpv;
		char	tmpbuf[2*MAX_FILLER + 1];
	#else
		char	tmpbuf[MAX_FILLER + 1];
	#endif

	ret = 0;
	if (maxlen < 0)
		return 0;
	if (!maxlen)
		maxlen = -1;

	while (*fmt) {
		if (*fmt != '%') {
			gfileWrite(f, fmt, 1);
			ret++; if (!--maxlen) return ret;
			fmt++;
			continue;
		}
		fmt++;

		p = s = tmpbuf;
		left_align = FALSE;
		filler = ' ';
		width = 0;
		precision = 0;

		if (*fmt == '-') {
			fmt++;
			left_align = TRUE;
		}
		if (*fmt == '0') {
			fmt++;
			filler = '0';
		}

		while (1) {
			c = *fmt++;
			if (c >= '0' && c <= '9') {
				c -= '0';
				width = width * 10 + c;
			} else if (c == '*')
				width = va_arg(arg, int);
			else
				break;
		}
		if (c == '.') {
			while (1) {
				c = *fmt++;
				if (c >= '0' && c <= '9') {
					c -= '0';
					precision = precision * 10 + c;
				} else if (c == '*')
					precision = va_arg(arg, int);
				else
					break;
			}
		}
		/* Long modifier.*/
		if (c == 'l' || c == 'L') {
			is_long = TRUE;
			if (*fmt)
				c = *fmt++;
		}
		else
			is_long = (c >= 'A') && (c <= 'Z');

		/* Command decoding.*/
		switch (c) {
		case 0:
			return ret;
		case 'c':
			filler = ' ';
			*p++ = va_arg(arg, int);
			break;
		case 's':
			filler = ' ';
			if ((s = va_arg(arg, char *)) == 0)
				s = "(null)";
			if (precision == 0)
				precision = 32767;
			for (p = s; *p && (--precision >= 0); p++);
			break;
		case 'D':
		case 'd':
			if (is_long)
				l = va_arg(arg, long);
			else
				l = va_arg(arg, int);
			if (l < 0) {
				*p++ = '-';
				l = -l;
			}
			p = ltoa_wd(p, l, 10, 0);
			break;
		#if GFILE_ALLOW_FLOATS
			case 'f':
				fpv = (float) va_arg(arg, double);
				if (fpv < 0) {
					*p++ = '-';
					fpv = -fpv;
				}
				l = fpv;
				p = ltoa_wd(p, l, 10, 0);
				*p++ = '.';
				l = (fpv - l) * FLOAT_PRECISION;
				p = ltoa_wd(p, l, 10, FLOAT_PRECISION / 10);
				break;
		#endif
		case 'X':
		case 'x':
			c = 16;
			goto unsigned_common;
		case 'U':
		case 'u':
			c = 10;
			goto unsigned_common;
		case 'O':
		case 'o':
			c = 8;
		unsigned_common:
			if (is_long)
				l = va_arg(arg, long);
			else
				l = va_arg(arg, int);
			p = ltoa_wd(p, l, c, 0);
			break;
		default:
			*p++ = c;
			break;
		}

		i = (int)(p - s);
		if ((width -= i) < 0)
			width = 0;
		if (left_align == FALSE)
			width = -width;
		if (width < 0) {
			if (*s == '-' && filler == '0') {
				gfileWrite(f, s++, 1);
				ret++; if (!--maxlen) return ret;
				i--;
			}
			do {
				gfileWrite(f, &filler, 1);
				ret++; if (!--maxlen) return ret;
			} while (++width != 0);
		}
		while (--i >= 0) {
			gfileWrite(f, s++, 1);
			ret++; if (!--maxlen) return ret;
		}
		while (width) {
			gfileWrite(f, &filler, 1);
			ret++; if (!--maxlen) return ret;
			width--;
		}
	}
	return ret;
}

#endif //GFX_USE_GFILE && GFILE_NEED_PRINTG