Skip to content

Commit afbfddb

Browse files
Changed some names and some spacing
1 parent 2dcb103 commit afbfddb

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed
Binary file not shown.

CEdev/examples/library_examples/fileio/demo_3/src/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void main(void) {
3232
real_t real_3_5 = os_FloatToReal(3.5);
3333

3434
/* Store the value '1.5+2.5i' into the varaible B */
35-
my_cplx = FloatToCplx(1.5, 2.5);
35+
my_cplx = FloatsToCplx(1.5, 2.5);
3636
ti_SetVar(TI_CPLX_TYPE, ti_B, &my_cplx);
3737

3838
/* Store the value '1.5' into the varaible A */
@@ -67,7 +67,7 @@ void main(void) {
6767
}
6868

6969
/* Stores some ints to a complex variable type */
70-
cplx_t Int24ToCplx(int real, int imag) {
70+
cplx_t Int24sToCplx(int real, int imag) {
7171
cplx_t res;
7272
res.real = os_Int24ToReal(real);
7373
res.real.sign |= TI_CPLX_TYPE;
@@ -77,7 +77,7 @@ cplx_t Int24ToCplx(int real, int imag) {
7777
}
7878

7979
/* Stores some floats to a complex variable type */
80-
cplx_t FloatToCplx(float real, float imag) {
80+
cplx_t FloatsToCplx(float real, float imag) {
8181
cplx_t res;
8282
res.real = os_FloatToReal(real);
8383
res.real.sign |= TI_CPLX_TYPE;
@@ -87,7 +87,7 @@ cplx_t FloatToCplx(float real, float imag) {
8787
}
8888

8989
/* Converts a pair of reals to a complex number */
90-
cplx_t RealToCplx(real_t real, real_t imag) {
90+
cplx_t RealsToCplx(real_t real, real_t imag) {
9191
cplx_t res;
9292
res.real = real;
9393
res.real.sign |= TI_CPLX_TYPE;
@@ -97,7 +97,7 @@ cplx_t RealToCplx(real_t real, real_t imag) {
9797
}
9898

9999
/* Converts strings to a complex variable type */
100-
cplx_t StrToCplx(char *real, char **real_end, char *imag, char **imag_end) {
100+
cplx_t StrsToCplx(char *real, char **real_end, char *imag, char **imag_end) {
101101
cplx_t res;
102102
res.real = os_StrToReal(real, real_end);
103103
res.real.sign |= TI_CPLX_TYPE;

CEdev/include/asm/cstartup.asm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
define .libs,space=ram
2222
define .startup,space=ram
2323

24-
_errno equ 0D008DCh
24+
_errno equ 0D008DCh
2525

2626
;-------------------------------------------------------------------------------
2727
; Standard CE startup module code
@@ -57,8 +57,8 @@ _init:
5757
push hl
5858
ld (__errsp+1),sp ; save the stack from death
5959
call _main
60-
__exit: ex de,hl
61-
60+
__exit:
61+
ex de,hl
6262
__errsp:
6363
ld sp,0
6464
pop hl
@@ -69,7 +69,8 @@ __errsp:
6969
pop iy ; restore iy for OS
7070
ex de,hl ; program return value in hl
7171
ret
72-
_exit: pop de
72+
_exit:
73+
pop de
7374
pop de
7475
jr __errsp
7576
;-------------------------------------------------------------------------------

CEdev/include/lib/ce/fileioc.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,37 +260,37 @@ uint8_t ti_RclVar(const uint8_t var_type, const char *var_name, void **data_stru
260260
* Allocates space for a string variable
261261
*/
262262
string_t *ti_AllocString(unsigned len, void (*malloc_routine)(size_t));
263-
#define ti_MallocString(len) ti_AllocString(len, (void*)malloc)
263+
#define ti_MallocString(len) ti_AllocString((len), ((void*)malloc))
264264

265265
/**
266266
* Allocates space for a list variable
267267
*/
268268
list_t *ti_AllocList(unsigned dim, void (*malloc_routine)(size_t));
269-
#define ti_MallocList(dim) ti_AllocList(dim, (void*)malloc)
269+
#define ti_MallocList(dim) ti_AllocList((dim), ((void*)malloc))
270270

271271
/**
272272
* Allocates space for a matrix variable
273273
*/
274274
matrix_t *ti_AllocMatrix(uint8_t rows, uint8_t cols, void (*malloc_routine)(size_t));
275-
#define ti_MallocMatrix(rows, cols) ti_AllocMatrix(rows, cols, (void*)malloc)
275+
#define ti_MallocMatrix(rows, cols) ti_AllocMatrix((rows), (cols), ((void*)malloc))
276276

277277
/**
278278
* Allocates space for a complex list variable
279279
*/
280280
cplx_list_t *ti_AllocCplxList(unsigned dim, void (*malloc_routine)(size_t));
281-
#define ti_MallocCplxList(dim) ti_AllocCplxList(dim, (void*)malloc)
281+
#define ti_MallocCplxList(dim) ti_AllocCplxList((dim), ((void*)malloc))
282282

283283
/**
284284
* Allocates space for an equation variable
285285
*/
286286
equ_t *ti_AllocEqu(unsigned len, void (*malloc_routine)(size_t));
287-
#define ti_MallocEqu(len) ti_AllocEqu(len, (void*)malloc)
287+
#define ti_MallocEqu(len) ti_AllocEqu((len), ((void*)malloc))
288288

289289
/**
290290
* Some more definitions using Ans
291291
*/
292-
#define TI_ANS_TYPE 0x00
293-
#define ti_Ans ("\x72\0")
292+
#define TI_ANS_TYPE (0x00)
293+
#define ti_Ans ("\x72\0")
294294

295295
/**
296296
* Some string definitions
@@ -304,6 +304,7 @@ equ_t *ti_AllocEqu(unsigned len, void (*malloc_routine)(size_t));
304304
#define ti_Str7 ("\xAA\x6\0")
305305
#define ti_Str8 ("\xAA\x7\0")
306306
#define ti_Str0 ("\xAA\x8\0")
307+
#define ti_StrT ('\xAA')
307308

308309
/**
309310
* Some equation definitions
@@ -318,6 +319,7 @@ equ_t *ti_AllocEqu(unsigned len, void (*malloc_routine)(size_t));
318319
#define ti_Y8 ("\x5E\x17\0")
319320
#define ti_Y9 ("\x5E\x18\0")
320321
#define ti_Y0 ("\x5E\x19\0")
322+
#define ti_EquT ('\x5E')
321323

322324
/**
323325
* Some real and complex defines
@@ -363,6 +365,7 @@ equ_t *ti_AllocEqu(unsigned len, void (*malloc_routine)(size_t));
363365
#define ti_MatH ("\x5C\x7\0")
364366
#define ti_MatI ("\x5C\x8\0")
365367
#define ti_MatJ ("\x5C\x9\0")
368+
#define ti_MatT ('\x5C')
366369

367370
/**
368371
* Some list defines
@@ -373,6 +376,7 @@ equ_t *ti_AllocEqu(unsigned len, void (*malloc_routine)(size_t));
373376
#define ti_L4 ("\x5D\x3\0")
374377
#define ti_L5 ("\x5D\x4\0")
375378
#define ti_L6 ("\x5D\x5\0")
379+
#define ti_LT ('\x5D')
376380

377381
/**
378382
* For compatibility reasons

CEdev/include/lib/ce/tice.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
/* Creates a random integer value */
18-
#define randInt(min, max) (unsigned)rand() % ((max) - (min) + 1) + (min))
18+
#define randInt(min, max) ((unsigned)rand() % ((max) - (min) + 1) + (min))
1919

2020
/* RTC define -- useful for srand() */
2121
#define rtc_Time() (*(volatile uint32_t*)0xF30044)
@@ -24,7 +24,7 @@
2424
#define RTC_UNFREEZE (1<<7)
2525
#define RTC_FREEZE (0<<7)
2626
#define RTC_LOAD (1<<6)
27-
#define RTC_ENABLE (1<<0)|RTC_UNFREEZE
27+
#define RTC_ENABLE ((1<<0)|RTC_UNFREEZE)
2828
#define RTC_DISABLE (0<<0)
2929

3030
/* RTC registers */
@@ -104,6 +104,8 @@
104104

105105
/* LCD defines */
106106
#define lcd_BacklightLevel (*(uint8_t*)0xF60024)
107+
#define lcd_Width (320)
108+
#define lcd_Height (240)
107109

108110
/* OS varaible type definitions */
109111
typedef struct { int8_t sign, exp; uint8_t mant[7]; } real_t;

0 commit comments

Comments
 (0)