-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDefines.h
executable file
·82 lines (71 loc) · 2.55 KB
/
Defines.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef DEFINES_H
#define DEFINES_H
// NOTE: The root folder's address is 37767. It is not represented in the EEPROM, as it is a hypothetical folder.
#define EEPROM_ADDRESS 0x54
#define MIN_ADDRESS 0
#define MAX_ADDRESS 32767
#define DELAY_TIME 4
#define ROOT_ADDRESS 32767
/***************************
* Element Name Sizes *
* *************************
*/
#define FILE_NAME_SIZE 10
#define FOLDER_NAME_SIZE 10
/***************************
* Partition Bounds *
* *************************
*/
#define FOLDER_PARTITION_LOWER_BOUND 1
#define FOLDER_PARTITION_UPPER_BOUND 1000
#define FILE_PARTITION_LOWER_BOUND 1001
#define FILE_PARTITION_UPPER_BOUND 28768
#define FILE_HEADER_PARTITION_LOWER_BOUND 28769
#define FILE_HEADER_PARTITION_UPPER_BOUND 32766
/***************************
* Partition Sizes *
* *************************
*/
const int fileHeaderPartitionSize = FILE_HEADER_PARTITION_UPPER_BOUND - FILE_HEADER_PARTITION_LOWER_BOUND + 1;
const int folderPartitionSize = FOLDER_PARTITION_UPPER_BOUND - FOLDER_PARTITION_LOWER_BOUND + 1;
/***************************
* Element Sizes *
* *************************
*/
const int folderSize = FOLDER_NAME_SIZE + 4;
const int fileHeaderSize = FILE_NAME_SIZE + 6;
/***************************
* Max Element Bounds *
* *************************
*/
// NOTE: maxFileHeaders is an upper bound on the number of files
const int maxFileHeaders = fileHeaderPartitionSize / (fileHeaderSize);
const int maxFolders = folderPartitionSize / (folderSize);
/***************************
* Command Names *
* *************************
*/
const char file_write[] = "file";
const char file_copy[] = "cpyfile";
const char file_move[] = "mvfile";
const char file_read[] = "read";
const char file_delete[] = "delfile";
const char file_rename[] = "rnfile";
const char folder_create[] = "mkdir";
const char folder_step_in[] = "in";
const char folder_step_out[] = "out";
const char folder_copy[] = "cpyfol";
const char folder_move[] = "mvfol";
const char folder_delete[] = "delfol";
const char folder_rename[] = "rnfol";
const char print_contents[] = "ls";
const char print_dir[] = "pwd";
const char format_sys[] = "format";
const char print_help[] = "help";
const char organize_mem[] = "omem";
/***************************
* Miscellaneous *
* *************************
*/
const char fileTerminator = '~';
#endif