-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.h
65 lines (47 loc) · 1.72 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*===========================================================================
pmbasic
config.h
This header contains definitions of sizes and limits. These must
be chosen carefully in the Arduino version, because RAM is so
scarce.
===========================================================================*/
#pragma once
#include <stdint.h>
// Define whether to build a version with int or long arithmetic.
// This decision affects all data stored and managed by PMBASIC,
// although it doesn't affect the program size particularly.
// Bear in mind that on AVRs, "long" is generally only 32-bit
//#define VARTYPE int16_t
#define VARTYPE int32_t
// Define the decimal indicator supplied to the printf() function,
// which depends on the integer size
#if VARIABLE_TYPE == long
#define PRINTF_DEC "%ld"
#else
#define PRINTF_DEC "%d"
#endif
// Longest number that can be parsed. This needs to be related to
// the data type used to represent numbers in binary (e.g., int)
#if VARIABLE_TYPE == long
#define MAX_NUMBER 10
#else
#define MAX_NUMBER 5
#endif
// Longest hex number that can be parsed. This needs to be related to
// the data type used to represent numbers in binary (e.g., int)
#if VARIABLE_TYPE == long
#define MAX_HEX_NUMBER 8
#else
#define MAX_HEX_NUMBER 4
#endif
// Longest line in total that we will handle. This includes the number,
// whitespace, and and terminating '\n', but not any terminating zero
#define MAX_LINE 81
// Largest number of nested GOSUB operations
#define MAX_GOSUB_STACK_DEPTH 10
// Largest character string that can be stored, in bytes (including
// terminating zero)
#define MAX_STRINGLEN 41
// Largest depth of nested FOR loops
#define MAX_FOR_STACK_DEPTH 4
#define TOKEN_MAX_LENGTH 40