Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* This contains the raw data for the font. */
static const unsigned char test_font_data[] =
{
#include "testfont.inc"
#include "testfont.inc"
};

/* However, C89 does not allow us to typecast a byte array into a
Expand Down
256 changes: 128 additions & 128 deletions examples/library_examples/graphx/text_custom/src/main.c

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions examples/library_examples/srldrvce/srl_echo/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,31 @@ static usb_error_t handle_usb_event(usb_event_t event, void *event_data,
if ((err = srl_UsbEventCallback(event, event_data, callback_data)) != USB_SUCCESS)
return err;
/* Enable newly connected devices */
if(event == USB_DEVICE_CONNECTED_EVENT && !(usb_GetRole() & USB_ROLE_DEVICE)) {
if (event == USB_DEVICE_CONNECTED_EVENT && !(usb_GetRole() & USB_ROLE_DEVICE)) {
usb_device_t device = event_data;
printf("device connected\n");
usb_ResetDevice(device);
}

/* Call srl_Open on newly enabled device, if there is not currently a serial device in use */
if(event == USB_HOST_CONFIGURE_EVENT || (event == USB_DEVICE_ENABLED_EVENT && !(usb_GetRole() & USB_ROLE_DEVICE))) {
if (event == USB_HOST_CONFIGURE_EVENT || (event == USB_DEVICE_ENABLED_EVENT && !(usb_GetRole() & USB_ROLE_DEVICE))) {

/* If we already have a serial device, ignore the new one */
if(has_srl_device) return USB_SUCCESS;
if (has_srl_device) return USB_SUCCESS;

usb_device_t device;
if(event == USB_HOST_CONFIGURE_EVENT) {
if (event == USB_HOST_CONFIGURE_EVENT) {
/* Use the device representing the USB host. */
device = usb_FindDevice(NULL, NULL, USB_SKIP_HUBS);
if(device == NULL) return USB_SUCCESS;
if (device == NULL) return USB_SUCCESS;
} else {
/* Use the newly enabled device */
device = event_data;
}

/* Initialize the serial library with the newly attached device */
srl_error_t error = srl_Open(&srl, device, srl_buf, sizeof srl_buf, SRL_INTERFACE_ANY, 9600);
if(error) {
if (error) {
/* Print the error code to the homescreen */
printf("Error %d initting serial\n", error);
return USB_SUCCESS;
Expand All @@ -63,9 +63,9 @@ static usb_error_t handle_usb_event(usb_event_t event, void *event_data,
has_srl_device = true;
}

if(event == USB_DEVICE_DISCONNECTED_EVENT) {
if (event == USB_DEVICE_DISCONNECTED_EVENT) {
usb_device_t device = event_data;
if(device == srl.dev) {
if (device == srl.dev) {
printf("device disconnected\n");
srl_Close(&srl);
has_srl_device = false;
Expand All @@ -80,7 +80,7 @@ int main(void) {
const usb_standard_descriptors_t *desc = srl_GetCDCStandardDescriptors();
/* Initialize the USB driver with our event handler and the serial device descriptors */
usb_error_t usb_error = usb_Init(handle_usb_event, NULL, desc, USB_DEFAULT_INIT_FLAGS);
if(usb_error) {
if (usb_error) {
usb_Cleanup();
printf("usb init error %u\n", usb_error);
do kb_Scan(); while(!kb_IsDown(kb_KeyClear));
Expand All @@ -92,17 +92,17 @@ int main(void) {

usb_HandleEvents();

if(has_srl_device) {
if (has_srl_device) {
char in_buf[64];

/* Read up to 64 bytes from the serial buffer */
size_t bytes_read = srl_Read(&srl, in_buf, sizeof in_buf);

/* Check for an error (e.g. device disconneced) */
if(bytes_read < 0) {
if (bytes_read < 0) {
printf("error %d on srl_Read\n", bytes_read);
has_srl_device = false;
} else if(bytes_read > 0) {
} else if (bytes_read > 0) {
/* Write the data back to serial */
srl_Write(&srl, in_buf, bytes_read);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ce/include/ti/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ bool os_TestFlagBitsFast(uint16_t offset_pattern);
#define OS_FLAGS_ASM1 0x21 /**< GROUP: Intentionally unused by TI, available for programs! */
#define OS_FLAGS_ASM2 0x22 /**< GROUP: Intentionally unused by TI, available for programs! */
#define OS_FLAGS_ARCHIVE 0x24 /**< GROUP: Archive stuff */
#define OS_FLAGS_ARCHIVE_CHECKBATTERY 0 /**< 1 = check battery levels in Arc_Unarc first and throw error if low */
#define OS_FLAGS_ARCHIVE_CHECKBATTERY 0 /**< 1 = check battery levels in Arc_Unarc first and throw error if low */
#define OS_FLAGS_GETSEND 0x24 /**< FLAGS */
#define OS_FLAGS_GETSEND_COMFAILED 1 /**< 1 = Get/Send Communication Failed */
#define OS_FLAGS_SELFTEST 0x24 /**< GROUP: Self-test screen */
Expand Down
4 changes: 2 additions & 2 deletions src/ce/include/ti/getcsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ bool boot_CheckOnPressed(void);
* uint8_t key, i = 0;
* char buffer[50];
*
* while((key = os_GetCSC()) != sk_Enter) {
* if(chars[key]) {
* while ((key = os_GetCSC()) != sk_Enter) {
* if (chars[key]) {
* buffer[i++] = chars[key];
* }
* }
Expand Down
2 changes: 1 addition & 1 deletion src/ce/include/ti/screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ uint24_t os_GetDrawBGColor(void);
#define os_PenCol (*(uint24_t*)0xD008D2)
/** `uint8_t`: Small font row position */
#define os_PenRow (*(uint8_t*)0xD008D5)
/** `uint16_t`: Small font background 565 BGR color */
/** `uint16_t`: Small font background 565 BGR color */
#define os_DrawBGColor (*(uint16_t*)0xD026AA)
/** `uint16_t`: Small font foreground 565 BGR color */
#define os_DrawFGColor (*(uint16_t*)0xD026AC)
Expand Down
2 changes: 1 addition & 1 deletion src/fileioc/fileioc.h
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ void ti_SetGCBehavior(void (*before)(void), void (*after)(void));
#define ti_K _Pragma("GCC warning \"'ti_K' is deprecated, use 'OS_VAR_K' instead\"") OS_VAR_K
#define ti_L _Pragma("GCC warning \"'ti_L' is deprecated, use 'OS_VAR_L' instead\"") OS_VAR_L
#define ti_M _Pragma("GCC warning \"'ti_M' is deprecated, use 'OS_VAR_M' instead\"") OS_VAR_M
#define ti_N _Pragma("GCC warning \"'ti_N' is deprecated, use 'OS_VAR_N' instead\"") OS_VAR_N
#define ti_N _Pragma("GCC warning \"'ti_N' is deprecated, use 'OS_VAR_N' instead\"") OS_VAR_N
#define ti_O _Pragma("GCC warning \"'ti_O' is deprecated, use 'OS_VAR_O' instead\"") OS_VAR_O
#define ti_P _Pragma("GCC warning \"'ti_P' is deprecated, use 'OS_VAR_P' instead\"") OS_VAR_P
#define ti_Q _Pragma("GCC warning \"'ti_Q' is deprecated, use 'OS_VAR_Q' instead\"") OS_VAR_Q
Expand Down
2 changes: 1 addition & 1 deletion src/fontlibc/fontlibc.h
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ fontlib_font_t *fontlib_GetFontByIndex(const char *font_pack_name, uint8_t index
* FONTLIB_MONOSPACE to REJECT monospaced fonts.
* @return Direct pointer to font, or NULL if no matching font is found
*/
fontlib_font_t *fontlib_GetFontByStyleRaw(const fontlib_font_pack_t *font_pack, uint8_t size_min, uint8_t size_max, uint8_t weight_min, uint8_t weight_max, uint8_t style_bits_set, uint8_t style_bits_reset);
fontlib_font_t *fontlib_GetFontByStyleRaw(const fontlib_font_pack_t *font_pack, uint8_t size_min, uint8_t size_max, uint8_t weight_min, uint8_t weight_max, uint8_t style_bits_set, uint8_t style_bits_reset);

/**
* Gets a pointer to a font, suitable for passing to SetFont(), given a font
Expand Down
2 changes: 1 addition & 1 deletion src/graphx/graphx.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ gfx_RotatedScaledTransparentSprite_NoClip(sprite, x, y, angle, 64)
* @param[in] angle 256 position angular integer.
* @see gfx_RotatedScaledTransparentSprite.
*/
#define gfx_RotatedTransparentSprite(sprite, x, y, angle) \
#define gfx_RotatedTransparentSprite(sprite, x, y, angle) \
gfx_RotatedScaledTransparentSprite(sprite, x, y, angle, 64)

/**
Expand Down
2 changes: 1 addition & 1 deletion src/keypadc/keypadc.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ typedef enum {
*
* Likewise, you can test keys with the following general format:
* @code{.cpp}
* if (kb_Data[group] & kb_Name){
* if (kb_Data[group] & kb_Name) {
* ...
* }
* @endcode
Expand Down
16 changes: 8 additions & 8 deletions src/libc/acosl.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
* ulp of -13337 at +0x1.ffffffe84b398p-1 assuming ideal atanl
*/
long double acosl(long double x) {
if (x < 0.5L) {
return F64_PI2 - asinl(x);
}
if (x <= 1.0L) {
return atanl((sqrtl(1.0L - x) * sqrtl(1.0L + x)) / x);
}
errno = EDOM;
return __builtin_nanl("");
if (x < 0.5L) {
return F64_PI2 - asinl(x);
}
if (x <= 1.0L) {
return atanl((sqrtl(1.0L - x) * sqrtl(1.0L + x)) / x);
}
errno = EDOM;
return __builtin_nanl("");
}
4 changes: 2 additions & 2 deletions src/libc/asinf.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ float asinf(float arg) {
arg_sign = signbit(arg);
arg = fabsf(arg);

if(arg > 1.0f) {
if (arg > 1.0f) {
errno = EDOM;
return 0.0f;
}

temp = sqrtf(1.0f - arg*arg);
if(arg > 0.7f) {
if (arg > 0.7f) {
temp = (float)M_PI_2 - atanf(temp/arg);
} else {
temp = atanf(arg/temp);
Expand Down
4 changes: 2 additions & 2 deletions src/libc/asinl.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ long double asinl(long double arg) {
arg_sign = signbit(arg);
arg = fabsl(arg);

if(arg > 1.0L) {
if (arg > 1.0L) {
errno = EDOM;
return 0.0L;
}

temp = sqrtl(1.0L - arg * arg);
if(arg > 0.7L) {
if (arg > 0.7L) {
temp = F64_PI2 - atanl(temp / arg);
} else {
temp = atanl(arg / temp);
Expand Down
6 changes: 3 additions & 3 deletions src/libc/expf.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ float expf(float arg) {
float temp1, temp2, xsq;
float ent;

if ( arg == 0.0f){
if ( arg == 0.0f) {
return 1.0f;
}
if ( arg < exp_min_arg ){
if ( arg < exp_min_arg ) {
return 0.0f;
}
if ( arg > exp_max_arg ){
if ( arg > exp_max_arg ) {
errno = ERANGE;
return HUGE_VALF;
}
Expand Down
8 changes: 4 additions & 4 deletions src/libc/expl.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define q2 0.17492876890931e4L

#if 0
#define exp_max_arg 709.79L
#define exp_max_arg 709.79L
#define exp_min_arg -744.45L
#else
/* mantissa is zero for these constants */
Expand All @@ -43,13 +43,13 @@ long double expl(long double arg) {
long double temp1, temp2, xsq;
long double ent;

if ( arg == 0.0L ){
if ( arg == 0.0L ) {
return 1.0L;
}
if ( arg < exp_min_arg ){
if ( arg < exp_min_arg ) {
return 0.0L;
}
if ( arg > exp_max_arg ){
if ( arg > exp_max_arg ) {
errno = ERANGE;
return HUGE_VALL;
}
Expand Down
6 changes: 3 additions & 3 deletions src/libc/frexpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static long double _frexpl_c_positive(long double x, int *expon) {
return val.flt;
}
/* isnormal(x) */
x_exp -= Float64_exp_bias;
x_exp -= Float64_exp_bias;
// frexp is ilogb(x) + 1
x_exp++;
*expon = x_exp;
Expand All @@ -51,8 +51,8 @@ static long double _frexpl_c_positive(long double x, int *expon) {
val.reg.BC |= 0x3FE0;
return val.flt;
}
/* iszero(x) */
if (val.bin == 0) {
/* iszero(x) */
if (val.bin == 0) {
// return unmodified
*expon = 0;
return val.flt;
Expand Down
2 changes: 1 addition & 1 deletion src/libc/hypot3f.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ float __hypot3f(float arg_x, float arg_y, float arg_z) {
F32_pun x, y, z;
x.flt = fabsf(arg_x);
y.flt = fabsf(arg_y);
z.flt = fabsf(arg_z);
z.flt = fabsf(arg_z);
if (y.bin < z.bin) {
float temp = y.flt;
y.flt = z.flt;
Expand Down
2 changes: 1 addition & 1 deletion src/libc/lgammal.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ long double lgammal(long double x) { /* the natural logarithm of the Gamma funct
long double v, w;
v = 1.0L;

// this will overflow when x < 173.0L
// this will overflow when x < 173.0L
const int maximum_iter = 173 + N;
for (int iter = 0; iter < maximum_iter; iter++) {
if (!(x < (long double)N)) {
Expand Down
2 changes: 1 addition & 1 deletion src/libc/logf.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ float logf(float arg)
return -HUGE_VALF;
}
x = frexpf(arg, & expon);
if ( x < F32_INV_SQRT2 ){
if ( x < F32_INV_SQRT2 ) {
x *= 2.0f;
expon--;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libc/logl.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ long double logl(long double arg)
return -HUGE_VALL;
}
x = frexpl(arg, & expon);
if ( x < F64_INV_SQRT2 ){
if ( x < F64_INV_SQRT2 ) {
x *= 2.0L;
expon--;
}
Expand Down
8 changes: 4 additions & 4 deletions src/libc/powf.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ float powf(float arg1, float arg2) {
float result;
long temp;

if ( arg1 > 0.0 ){
if ( arg1 > 0.0 ) {
return expf( arg2 * logf( arg1 ) );
}
if ( arg1 < 0.0 ){
if ( arg1 < 0.0 ) {
temp = (long)arg2;
if ( (float)temp == arg2 ){
if ( (float)temp == arg2 ) {
result = expf( arg2 * logf( -arg1 ) );
return temp & 1 ? -result : result;
}
errno = EDOM;
}
if ( arg2 <= 0.0 ){
if ( arg2 <= 0.0 ) {
errno = EDOM;
}
return 0.0;
Expand Down
8 changes: 4 additions & 4 deletions src/libc/powl.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ long double powl(long double x, long double y) {
long double result;
long temp;

if ( x > 0.0L ){
if ( x > 0.0L ) {
return expl( y * logl( x ) );
}
if ( x < 0.0L ){
if ( x < 0.0L ) {
temp = (long)y;
if ( (long double)temp == y ){
if ( (long double)temp == y ) {
result = expl( y * logl( -x ) );
return temp & 1 ? -result : result;
}
errno = EDOM;
}
if ( y <= 0.0L ){
if ( y <= 0.0L ) {
errno = EDOM;
}
return 0.0L;
Expand Down
12 changes: 6 additions & 6 deletions src/libc/sinhl.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
long double sinhl(long double arg) {
long double temp, argsq, x;
x = fabsl(arg);
if (x < 0.5L) {
if (x < 0.5L) {
argsq = x * x;
temp = (((p3*argsq+p2)*argsq+p1)*argsq+p0) * x;
temp /= (((argsq+q2)*argsq+q1)*argsq+q0);
} else if (x < 709.0L) {
temp = (expl(x) - expl(-x)) / 2.0L;
} else {
temp = expl(x - F64_LN2);
}
} else if (x < 709.0L) {
temp = (expl(x) - expl(-x)) / 2.0L;
} else {
temp = expl(x - F64_LN2);
}
return copysignl(temp, arg);
}
8 changes: 4 additions & 4 deletions src/libc/sqrtf.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ asm
; only works for normalized values
; CC: 9F + 12R + 9W + 1 | 8 bytes
__f32_fast_div4:
pop bc, hl, de
dec e ; subtracts 2 from the exponent
push de, hl, bc
ret
pop bc, hl, de
dec e ; subtracts 2 from the exponent
push de, hl, bc
ret
*/
float _f32_fast_div4(float x);

Expand Down
Loading
Loading