LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lms2012.h
Go to the documentation of this file.
1 /*
2  * LEGO® MINDSTORMS EV3
3  *
4  * Copyright (C) 2010-2013 The LEGO Group
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 
38 //#define DEBUG //!< When defined debug messages is output on standard I/O (d_uart is different)
39 
40 #define TERMINAL_ENABLED 0
41 #define DEBUG_UART 4
42 
43 
44 /* \endverbatim */
45 
46 //#define DEBUG_VM
47 //#define DEBUG_TRACE_TASK
48 //#define DEBUG_C_COM
49 //#define DEBUG_C_INPUT
50 //#define DEBUG_C_INPUT_DAISYCHAIN
51 //#define DEBUG_C_INPUT_DATALOG
52 //#define DEBUG_C_INPUT_FAST_DATALOG
53 //#define DEBUG_C_MEMORY
54 //#define DEBUG_C_MEMORY_LOG
55 //#define DEBUG_C_MEMORY_FILE
56 //#define DEBUG_C_MEMORY_LOW
57 //#define DEBUG_C_SOUND
58 //#define DEBUG_C_UI
59 
60 //#define DEBUG_D_ANALOG
61 //#define DEBUG_D_POWER
62 //#define DEBUG_D_UART
63 //#define DEBUG_D_UART_ERROR
64 //#define DEBUG_D_UI
65 //#define DEBUG_D_SOUND
66 //#define DEBUG_D_IIC
67 //#define DEBUG_D_USBDEV
68 
69 //#define ENABLE_TEST_ON_PORT4
70 
71 //#define BUFPRINTSIZE 100000
72 //#define REMEMBER_TO_ENABLE_SAVE_USER_DATA
73 //#define REMEMBER_TO_FIX_TYPEDATA
74 
75 //#define DEBUG_TRACE_USB_COMMAND
76 //#define DEBUG_TRACE_MODE_CHANGE
77 //#define DEBUG_TRACE_KEY
78 //#define DEBUG_TRACE_ANGLE
79 //#define DEBUG_TRACE_US
80 //#define DEBUG_TRACE_VM
81 //#define DEBUG_TRACE_DAISYCHAIN
82 //#define DEBUG_BYTECODE_TIME
83 //#define DEBUG_TRACE_FREEZE
84 //#define DEBUG_TRACE_FILENAME
85 //#define DEBUG_SDCARD
86 //#define DEBUG_USBSTICK
87 //#define DEBUG_VIRTUAL_BATT_TEMP
88 //#define DEBUG_TEMP_SHUTDOWN
89 //#define DEBUG_BACK_BLOCKED
90 #define DEBUG_RECHARGEABLE
91 
92 
93 
94 #ifndef LMS2012_H_
95 #define LMS2012_H_
96 
97 // HARDWARE PLATFORM
98 
99 #define EP2 4
100 #define FINALB 3
101 #define FINAL 2
102 #define SIMULATION 0
103 
104 #define PLATFORM_START FINAL
105 #define PLATFORM_END EP2
106 
107 // Will be removed when not used anymore
108 #define A4 -1
109 #define EVALBOARD -2
110 #define ONE2ONE 1
111 
112 
113 #ifdef LEGO_SIMULATION
114  #define HARDWARE SIMULATION
115 #else
116 
117 #ifndef HARDWARE
118  #define HARDWARE FINAL
119 #endif
120 
121 #endif
122 
123 // Support for module parameter "HwId"
124 //
125 // Readout File int PCB
126 //
127 // V1.00 10 10 MP (h = home, e = education)
128 // V0.50 05 5 EP3
129 // V0.40 04 4 EP2
130 // V0.30 03 3 EP1 (FINALB) (DEFAULT if file "HwId" not found)
131 // V0.20 02 2 FINAL
132 
133 #ifdef HW_ID_SUPPORT
134 
135 char *HwId = "03";
136 
137 #define HWID (((HwId[0] - '0') * 10) + (HwId[1] - '0'))
138 
139 #endif
140 
141 
142 // FIRMWARE VARIANTS
143 
144 //#define OLDCALL //!< Don't use optimised sub calls
145 //#define DISABLE_PRU_UARTS //!< Don't use port 3 and 4 for UART sensors
146 //#define DISABLE_OLD_COLOR //!< Don't support NXT color sensor
147 //#define DISABLE_ADC //!< Don't use ADC (no clock EMC test)
148 //#define ADC_BITBANGING //!< Don't use SPI for a/d converter
149 //#define DISABLE_DAISYCHAIN
150 //#define DISABLE_DAISYCHAIN_COM_CALL
151 //#define DISABLE_FAST_DATALOG_BUFFER
152 //#define DISABLE_BUMBED
153 //#define LOG_ASCII
154 //#define DISABLE_FIQ_IIC
155 #define UART1_FAKE_INTERRUPT
156 //#define DISABLE_LOW_VOLTAGE
157 //#define ENABLE_HIGH_CURRENT
158 //#define DISABLE_LOW_MEMORY
159 //#define DISABLE_UART_DATA_ERROR
160 #define DISABLE_PREEMPTED_VM
161 //#define DISABLE_SDCARD_SUPPORT
162 #define DISABLE_USBSTICK_SUPPORT
163 //#define ENABLE_PERFORMANCE_TEST
164 //#define ENABLE_LOAD_TEST
165 //#define ENABLE_MEMORY_TEST
166 //#define ENABLE_STATUS_TEST
167 //#define DISABLE_VIRTUAL_BATT_TEMP
168 //#define DISABLE_SOUND
169 //#define DISABLE_PAR_ALIGNMENT //!< Disable possibility to align sub call parameter types
170 //#define DISABLE_NEW_CALL_MUTEX //!< Disable smart object switching after return from non reentrant sub call (enables blocked thread call)
171 //#define DISABLE_SYSTEM_BYTECODE //!< Disable the use of opSYSTEM command
172 //#define DISABLE_FILENAME_CHECK //!< Disable "c_memory" filename check
173 //#define DISABLE_AD_WORD_PROTECT //!< Disable A/D word result protection
174 
175 #define TESTDEVICE 3
176 
177 //#ifdef Linux_X86
178 //#define DISABLE_DAISYCHAIN
179 //#define DISABLE_DAISYCHAIN_COM_CALL
180 //#endif
181 
182 #ifndef PCASM
183 #include <asm/types.h>
184 #endif
185 
186 #include "lmstypes.h"
187 #include "bytecodes.h"
188 
189 // Hardware
190 
191 #define OUTPUTS vmOUTPUTS
192 #define INPUTS vmINPUTS
193 #define BUTTONS vmBUTTONS
194 #define LEDS vmLEDS
195 
196 #define LCD_WIDTH vmLCD_WIDTH
197 #define LCD_HEIGHT vmLCD_HEIGHT
198 #define TOPLINE_HEIGHT vmTOPLINE_HEIGHT
199 #define LCD_STORE_LEVELS vmLCD_STORE_LEVELS
200 
201 // Software
202 
203 #define FG_COLOR vmFG_COLOR
204 #define BG_COLOR vmBG_COLOR
205 
206 #define CHAIN_DEPT vmCHAIN_DEPT
207 
208 #define EVENT_BT_PIN vmEVENT_BT_PIN
209 
210 // Folders
211 
212 #define MEMORY_FOLDER vmMEMORY_FOLDER
213 #define PROGRAM_FOLDER vmPROGRAM_FOLDER
214 #define DATALOG_FOLDER vmDATALOG_FOLDER
215 #define SDCARD_FOLDER vmSDCARD_FOLDER
216 #define USBSTICK_FOLDER vmUSBSTICK_FOLDER
217 
218 // Files
219 #define DETAILS_FILE vmDETAILS_FILE
220 
221 // Extensions
222 
223 #define EXT_SOUND vmEXT_SOUND
224 #define EXT_GRAPHICS vmEXT_GRAPHICS
225 #define EXT_BYTECODE vmEXT_BYTECODE
226 #define EXT_TEXT vmEXT_TEXT
227 #define EXT_DATALOG vmEXT_DATALOG
228 #define EXT_PROGRAM vmEXT_PROGRAM
229 #define EXT_CONFIG vmEXT_CONFIG
230 
231 
236 #define PROJECT "LMS2012"
237 #define VERS 1.04
238 #define SPECIALVERS 'H'
239 
240 
241 #define MAX_PROGRAMS SLOTS
242 #define MAX_BREAKPOINTS 4
243 #define MAX_LABELS 32
244 #define MAX_DEVICE_TYPE 127
245 #define MAX_VALID_TYPE vmMAX_VALID_TYPE
246 #define MAX_DEVICE_MODES 8
247 #define MAX_DEVICE_DATASETS 8
248 #define MAX_DEVICE_DATALENGTH 32
249 
250 #define MAX_DEVICE_BUSY_TIME 1200
251 
252 #define MAX_DEVICE_TYPES ((MAX_DEVICE_TYPE + 1) * MAX_DEVICE_MODES)
253 
254 #define MAX_FRAMES_PER_SEC 10
255 
256 #define CACHE_DEEPT 10
257 #define MAX_HANDLES 250
258 
259 #define MAX_ARRAY_SIZE 1000000000
260 #define MIN_ARRAY_ELEMENTS 0
261 
262 #define INSTALLED_MEMORY 6000
263 #define RESERVED_MEMORY 100
264 #define LOW_MEMORY 500
265 
266 #define LOGBUFFER_SIZE 1000
267 #define DEVICE_LOGBUF_SIZE 300
268 #define MIN_LIVE_UPDATE_TIME 10
269 
270 #define MIN_IIC_REPEAT_TIME 10
271 #define MAX_IIC_REPEAT_TIME 1000
272 
273 #define MAX_COMMAND_BYTECODES 64
274 #define MAX_COMMAND_LOCALS 64
275 #define MAX_COMMAND_GLOBALS 1021
276 
277 #define UI_PRIORITY 20
278 #define C_PRIORITY 200
279 
280 #ifndef DISABLE_PREEMPTED_VM
281 #define PRG_PRIORITY 2000
282 #else
283 #define PRG_PRIORITY 200
284 #endif
285 
286 #define BUTTON_DEBOUNCE_TIME 30
287 #define BUTTON_START_REPEAT_TIME 400
288 #define BUTTON_REPEAT_TIME 200
289 
290 #define LONG_PRESS_TIME 3000
291 
292 #define ADC_REF 5000
293 #define ADC_RES 4095
294 
295 #define IN1_ID_HYSTERESIS 50
296 #define OUT5_ID_HYSTERESIS 100
297 
298 #define DEVICE_UPDATE_TIME 1000000
299 #define DELAY_TO_TYPEDATA 10000
300 #define DAISYCHAIN_MODE_TIME 10
301 #define MAX_FILE_HANDLES 64
302 #define MIN_HANDLE 3
303 
304 #define ID_LENGTH 7
305 #define NAME_LENGTH 12
306 
307 #define ERROR_BUFFER_SIZE 8
308 
309 #define PWM_DEVICE "lms_pwm"
310 #define PWM_DEVICE_NAME "/dev/lms_pwm"
311 
312 #define MOTOR_DEVICE "lms_motor"
313 #define MOTOR_DEVICE_NAME "/dev/lms_motor"
314 
315 #define ANALOG_DEVICE "lms_analog"
316 #define ANALOG_DEVICE_NAME "/dev/lms_analog"
317 
318 #define POWER_DEVICE "lms_power"
319 #define POWER_DEVICE_NAME "/dev/lms_power"
320 
321 #define DCM_DEVICE "lms_dcm"
322 #define DCM_DEVICE_NAME "/dev/lms_dcm"
323 
324 #define UI_DEVICE "lms_ui"
325 #define UI_DEVICE_NAME "/dev/lms_ui"
326 
327 #define LCD_DEVICE "lms_display"
328 //#define LCD_DEVICE_NAME "/dev/lms_display"
329 #define LCD_DEVICE_NAME "/dev/fb0"
330 
331 #define UART_DEVICE "lms_uart"
332 #define UART_DEVICE_NAME "/dev/lms_uart"
333 
334 #define USBDEV_DEVICE "lms_usbdev"
335 #define USBDEV_DEVICE_NAME "/dev/lms_usbdev"
336 
337 #define USBHOST_DEVICE "lms_usbhost"
338 #define USBHOST_DEVICE_NAME "/dev/lms_usbhost"
339 
340 #define SOUND_DEVICE "lms_sound"
341 #define SOUND_DEVICE_NAME "/dev/lms_sound"
342 
343 #define IIC_DEVICE "lms_iic"
344 #define IIC_DEVICE_NAME "/dev/lms_iic"
345 
346 #define BT_DEVICE "lms_bt"
347 #define BT_DEVICE_NAME "/dev/lms_bt"
348 
349 #define UPDATE_DEVICE "lms_update"
350 #define UPDATE_DEVICE_NAME "/dev/lms_update"
351 
352 #define TEST_PIN_DEVICE "lms_tst_pin"
353 #define TEST_PIN_DEVICE_NAME "/dev/lms_tst_pin"
354 
355 #define TEST_UART_DEVICE "lms_tst_uart"
356 #define TEST_UART_DEVICE_NAME "/dev/lms_tst_uart"
357 
358 
359 #define DIR_DEEPT vmDIR_DEEPT
360 
361 // File
362 
363 //***********************************************************************************************************************
365 
366 #define FILENAMESIZE vmFILENAMESIZE
367 #define FILENAME_SIZE 52
368 #define FOLDERNAME_SIZE 10
369 #define SUBFOLDERNAME_SIZE FILENAME_SIZE
370 
371 #define MAX_FILENAME_SIZE (FOLDERNAME_SIZE + SUBFOLDERNAME_SIZE + FILENAME_SIZE + 5)
372 
373 //***********************************************************************************************************************
374 
375 #define TYPEDATE_FILE_NAME "typedata"
376 #define ICON_FILE_NAME "icon"
377 #define TEXT_FILE_NAME "text"
378 
379 #define DEMO_FILE_NAME "../prjs/BrkProg_SAVE/Demo.rpf"
380 
381 // Memory
382 
383 
384 
385 
386 
387 // SD card
388 
389 #ifdef Linux_X86
390 #define SDCARD_DEVICE1 "/dev/mmcblk0"
391 #define SDCARD_DEVICE2 "/dev/mmcblk0p1"
392 #else
393 #define SDCARD_DEVICE1 "/dev/mmcblk0"
394 #define SDCARD_DEVICE2 "/dev/mmcblk0p1"
395 #endif
396 
397 #define SDCARD_MOUNT "./mount_sdcard"
398 #define SDCARD_UNMOUNT "./unmount_sdcard"
399 
400 // USB stick
401 
402 #ifndef Linux_X86
403 #define USBSTICK_DEVICE "/dev/sda"
404 #else
405 #define USBSTICK_DEVICE "/dev/sdf1"
406 #endif
407 
408 #define USBSTICK_MOUNT "./mount_usbstick"
409 #define USBSTICK_UNMOUNT "./unmount_usbstick"
410 
411 /*
412 #define DEFAULT_PRJS_FOLDER "~/lms2012/prjs" //!< Project folder name without trailing "/"
413 #define DEFAULT_APPS_FOLDER "~/lms2012/apps" //!< Applet folder name without trailing "/"
414 #define DEFAULT_TOOLS_FOLDER "~/lms2012/tools" //!< Setting folder name without trailing "/"
415 #define DEFAULT_SYS_FOLDER "~/lms2012/sys" //!< System folder name without trailing "/"
416 #define DEFAULT_SETUP_FOLDER "~/lms2012/sys" //!< Setup folder name without trailing "/"
417 #define DEFAULT_SD_FOLDER "~/lms2012/SD Card" //!< Sd card folder name without trailing "/"
418 #define DEFAULT_USB_FOLDER "~/lms2012/USB Memory"//!< USB Memory folder name without trailing "/"
419 */
420 
421 #define DEFAULT_FOLDER "ui"
422 #define DEFAULT_UI "ui"
423 
424 #define DEFAULT_VOLUME vmDEFAULT_VOLUME
425 #define DEFAULT_SLEEPMINUTES vmDEFAULT_SLEEPMINUTES
426 
427 #define COM_CMD_DEVICE_NAME USBDEV_DEVICE_NAME
428 
429 
446 #define BATT_INDICATOR_HIGH 7500
447 #define BATT_INDICATOR_LOW 6200
448 
449 #define ACCU_INDICATOR_HIGH 7500
450 #define ACCU_INDICATOR_LOW 7100
451 
452 
462 #define LOW_VOLTAGE_SHUTDOWN_TIME 10000
463 
464 #define BATT_WARNING_HIGH 6.2
465 #define BATT_WARNING_LOW 5.5
466 #define BATT_SHUTDOWN_HIGH 5.5
467 #define BATT_SHUTDOWN_LOW 4.5
468 
469 #define ACCU_WARNING_HIGH 7.1
470 #define ACCU_WARNING_LOW 6.5
471 #define ACCU_SHUTDOWN_HIGH 6.5
472 #define ACCU_SHUTDOWN_LOW 6.0
473 
474 
478 #ifdef ENABLE_HIGH_CURRENT
479 
488 #define LOAD_SHUTDOWN_FAIL 4.0
489 #define LOAD_SHUTDOWN_HIGH 3.0
490 #define LOAD_BREAK_EVEN 1.75
491 
492 #define LOAD_SLOPE_UP 0.2
493 #define LOAD_SLOPE_DOWN 0.1
494 
495 
499 #endif
500 
501 #ifndef DISABLE_VIRTUAL_BATT_TEMP
502 
511 #define TEMP_SHUTDOWN_FAIL 45.0
512 #define TEMP_SHUTDOWN_WARNING 40.0
513 
514 
518 #endif
519 
520 #define UPDATE_TIME1 2
521 #define UPDATE_TIME2 10
522 #define UPDATE_MEMORY 200
523 #define UPDATE_SDCARD 500
524 #define UPDATE_USBSTICK 500
525 
526 
527 // Per start of (polution) defines
528 #define MAX_SOUND_DATA_SIZE 250
529 #define SOUND_CHUNK 250
530 #define SOUND_ADPCM_CHUNK 125
531 #define SOUND_MASTER_CLOCK 132000000
532 #define SOUND_TONE_MASTER_CLOCK 1031250
533 #define SOUND_MIN_FRQ 250
534 #define SOUND_MAX_FRQ 10000
535 #define SOUND_MAX_LEVEL 8
536 #define SOUND_FILE_BUFFER_SIZE SOUND_CHUNK + 2 // 12.8 mS @ 8KHz
537 #define SOUND_BUFFER_COUNT 3
538 #define SOUND_FILE_FORMAT_NORMAL 0x0100 // RSO-file
539 #define SOUND_FILE_FORMAT_COMPRESSED 0x0101 // RSO-file compressed
540 // Per end of defines
541 
542 
549 #define VtoC(V) ((UWORD)((V * ADC_RES) / ADC_REF))
550 #define CtoV(C) ((UWORD)((C * ADC_REF) / ADC_RES))
551 #define MtoV(M) ((UWORD)((M * ADC_REF * 100) / (ADC_RES * 52)))
552 
553 #define KB 1024
554 
555 enum
556 {
557  FALSE = 0,
558  TRUE = 1,
559 };
560 
561 
562 // Reserved device types
563 typedef enum
564 {
565 // TYPE_KEEP = 0, //!< Type value that won't change type in byte codes
570 
574 
577 
579 
581 
582  TYPE_NXT_IIC = 123,
584  TYPE_UNKNOWN = 125,
585  TYPE_NONE = 126,
586  TYPE_ERROR = 127,
587 }
588 TYPE;
589 
590 
591 
603 typedef enum
604 {
605  CONN_UNKNOWN = 111,
606 
607  CONN_DAISYCHAIN = 117,
608  CONN_NXT_COLOR = 118,
609  CONN_NXT_DUMB = 119,
610  CONN_NXT_IIC = 120,
611 
612  CONN_INPUT_DUMB = 121,
613  CONN_INPUT_UART = 122,
614 
615  CONN_OUTPUT_DUMB = 123,
616  CONN_OUTPUT_INTELLIGENT = 124,
617  CONN_OUTPUT_TACHO = 125,
618 
619  CONN_NONE = 126,
620  CONN_ERROR = 127,
621 }
622 CONN;
623 
624 /*\endverbatim
625  *
626  * \n
627  */
628 
629 
630 
665 typedef enum
666 {
667  NOBREAK = 0x0100,
668  STOPBREAK = 0x0200,
669  SLEEPBREAK = 0x0400,
670  INSTRBREAK = 0x0800,
671  BUSYBREAK = 0x1000,
672  PRGBREAK = 0x2000,
673  USERBREAK = 0x4000,
674  FAILBREAK = 0x8000
675 }
676 DSPSTAT;
677 
678 typedef void (*PRIM)(void);
679 
680 
681 
701 typedef struct // Object
702 {
703  IP Ip;
705 #ifndef DISABLE_NEW_CALL_MUTEX
708 #else
709  UWORD ObjStatus;
710 #endif
711  union
712  {
715  }u;
716  VARDATA Local[];
717 }
718 OBJ;
719 
720 
724 typedef struct
725 {
728 }
729 BRKP;
730 
734 typedef struct
735 {
738 
741 
749 
752 
755  RESULT Result;
756 
757  BRKP Brkp[MAX_BREAKPOINTS];
758 
759  LABEL Label[MAX_LABELS];
761 
762  DATA8 Name[FILENAME_SIZE];
763 
764 }
765 PRG;
766 
767 
768 #define TYPE_NAME_LENGTH 11
769 #define SYMBOL_LENGTH 4
770 
771 
774 typedef struct // if data type changes - remember to change "cInputTypeDataInit" !
775 {
794  SBYTE Symbol[SYMBOL_LENGTH + 1];
796 }
797 TYPES;
798 
799 #define TYPE_PARAMETERS 19
800 #define MAX_DEVICE_INFOLENGTH 54
801 
802 
807 typedef enum
808 {
844 }
845 ERR;
846 
847 // INTERFACE FOR SHARED LIBRARIES
848 
849 extern void PrimParAdvance(void); // Dummy get parameter
850 
851 extern void* PrimParPointer(void); // Get pointer to primitives and system calls parameters
852 
853 extern IP GetImageStart(void); // Get pointer to start of image
854 
855 extern void SetDispatchStatus(DSPSTAT Status); // Set dispatch status (result from executing byte code)
856 
857 extern void SetInstructions(ULONG Instructions); // Set number of instructions before VMThread change
858 
859 extern PRGID CurrentProgramId(void); // Get current program id
860 
861 extern OBJSTAT ProgramStatus(PRGID PrgId); // Get program status
862 
863 extern OBJSTAT ProgramStatusChange(PRGID PrgId); // Get program status change
864 
865 extern void ProgramEnd(PRGID PrgId);
866 
867 extern OBJID CallingObjectId(void); // Get calling objects id
868 
869 extern void AdjustObjectIp(IMOFFS Value); // Adjust IP
870 
871 extern IP GetObjectIp(void); // Get IP
872 
873 extern void SetObjectIp(IP Ip); // Set IP
874 
875 extern ULONG GetTimeUS(void); // Get uS
876 
877 extern ULONG GetTimeMS(void); // Get mS
878 
879 extern ULONG GetTime(void); // Get actual program time
880 
881 extern ULONG CurrentObjectIp(void); // Get current object ip
882 
883 extern void VmPrint(char *pString); // print string
884 
885 extern void SetTerminalEnable(DATA8 Value); // Terminal enable/disable
886 
887 extern DATA8 GetTerminalEnable(void); // Get terminal enable state
888 
889 extern void GetResourcePath(char *pString,DATA8 MaxLength);// Get resource path
890 
891 extern void* VmMemoryResize(HANDLER Handle,DATA32 Elements);
892 
893 extern void SetVolumePercent(DATA8 Volume);
894 
895 extern DATA8 GetVolumePercent(void);
896 
897 extern void SetSleepMinutes(DATA8 Minutes);
898 
899 extern DATA8 GetSleepMinutes(void);
900 
901 extern DSPSTAT ExecuteByteCode(IP pByteCode,GP pGlobals,LP pLocals); // Execute byte code stream (C-call)
902 
903 extern DATA8 CheckSdcard(DATA8 *pChanged,DATA32 *pTotal,DATA32 *pFree,DATA8 Force);
904 
905 extern DATA8 CheckUsbstick(DATA8 *pChanged,DATA32 *pTotal,DATA32 *pFree,DATA8 Force);
906 
907 extern void SetUiUpdate(void);
908 
909 extern RESULT ValidateChar(DATA8 *pChar,DATA8 Set);
910 
911 extern RESULT ValidateString(DATA8 *pString,DATA8 Set);
912 
913 extern ERR LogErrorGet(void);
914 
915 #ifdef BUFPRINTSIZE
916 extern void BufPrint(char Cmd,char *pFormat, ...);
917 #endif
918 
919 
920 
921 #define ERR_STRING_SIZE vmERR_STRING_SIZE // Inclusive zero termination
922 
923 extern void LogErrorNumber(ERR Error); // Log error number
925 
926 
927 #ifndef DISABLE_OLD_COLOR
928 
929 #define COLORS 4
930 #define CALPOINTS 3
931 
932 
943 typedef struct
944 {
945  ULONG Calibration[CALPOINTS][COLORS];
946  UWORD CalLimits[CALPOINTS - 1];
947  UWORD Crc;
948  UWORD ADRaw[COLORS];
949  UWORD SensorRaw[COLORS];
950 }
951 COLORSTRUCT;
952 
953 /*\endverbatim
954  *
955  * \n
956  */
957 
958 #endif
959 
960 
961 // INTERFACE BETWEEN SHARED LIBRARIES AND MODULES
962 
974 typedef struct
975 {
976  DATA16 InPin1[INPUTS];
977  DATA16 InPin6[INPUTS];
978  DATA16 OutPin5[OUTPUTS];
979  DATA16 BatteryTemp;
980  DATA16 MotorCurrent;
981  DATA16 BatteryCurrent;
982  DATA16 Cell123456;
983 #ifndef DISABLE_FAST_DATALOG_BUFFER
984  DATA16 Pin1[INPUTS][DEVICE_LOGBUF_SIZE];
985  DATA16 Pin6[INPUTS][DEVICE_LOGBUF_SIZE];
986  UWORD Actual[INPUTS];
987  UWORD LogIn[INPUTS];
988  UWORD LogOut[INPUTS];
989 #endif
990 #ifndef DISABLE_OLD_COLOR
991  COLORSTRUCT NxtCol[INPUTS];
992 #endif
993  DATA16 OutPin5Low[OUTPUTS];
994 
995  DATA8 Updated[INPUTS];
996 
997  DATA8 InDcm[INPUTS];
998  DATA8 InConn[INPUTS];
999 
1000  DATA8 OutDcm[OUTPUTS];
1001  DATA8 OutConn[OUTPUTS];
1002 #ifndef DISABLE_PREEMPTED_VM
1003  UWORD PreemptMilliSeconds;
1004 #endif
1005 }
1006 ANALOG;
1007 
1008 /*\endverbatim
1009  *
1010  * \n
1011  */
1012 
1013 
1026 #define UART_DATA_LENGTH MAX_DEVICE_DATALENGTH
1027 #define UART_BUFFER_SIZE 64
1028 
1029 typedef struct
1030 {
1031  TYPES TypeData[INPUTS][MAX_DEVICE_MODES];
1032 
1033 #ifndef DISABLE_FAST_DATALOG_BUFFER
1034  UWORD Repeat[INPUTS][DEVICE_LOGBUF_SIZE];
1035  DATA8 Raw[INPUTS][DEVICE_LOGBUF_SIZE][UART_DATA_LENGTH];
1036  UWORD Actual[INPUTS];
1037  UWORD LogIn[INPUTS];
1038 #else
1039  DATA8 Raw[INPUTS][UART_DATA_LENGTH];
1040 #endif
1041  DATA8 Status[INPUTS];
1042  DATA8 Output[INPUTS][UART_DATA_LENGTH];
1043  DATA8 OutputLength[INPUTS];
1044 }
1045 UART;
1046 
1047 /*\endverbatim
1048  *
1049  * \n
1050  */
1051 
1052 
1053 #define UART_PORT_CHANGED 0x01
1054 #define UART_DATA_READY 0x08
1055 #define UART_WRITE_REQUEST 0x10
1056 
1057 
1058 typedef struct
1059 {
1060  DATA8 Connection[INPUTS];
1061  DATA8 Type[INPUTS];
1062  DATA8 Mode[INPUTS];
1063 }
1064 DEVCON;
1065 
1066 
1067 typedef struct
1068 {
1072 }
1073 UARTCTL;
1074 
1075 #define UART_SET_CONN _IOWR('u',0,DEVCON)
1076 #define UART_READ_MODE_INFO _IOWR('u',1,UARTCTL)
1077 #define UART_NACK_MODE_INFO _IOWR('u',2,UARTCTL)
1078 #define UART_CLEAR_CHANGED _IOWR('u',3,UARTCTL)
1079 
1080 
1093 #define IIC_DATA_LENGTH MAX_DEVICE_DATALENGTH
1094 #define IIC_NAME_LENGTH 8
1095 
1096 typedef struct
1097 {
1098  TYPES TypeData[INPUTS][MAX_DEVICE_MODES];
1099 
1100 #ifndef DISABLE_FAST_DATALOG_BUFFER
1101  UWORD Repeat[INPUTS][DEVICE_LOGBUF_SIZE];
1102  DATA8 Raw[INPUTS][DEVICE_LOGBUF_SIZE][IIC_DATA_LENGTH];
1103  UWORD Actual[INPUTS];
1104  UWORD LogIn[INPUTS];
1105 #else
1106  DATA8 Raw[INPUTS][IIC_DATA_LENGTH];
1107 #endif
1108  DATA8 Status[INPUTS];
1109  DATA8 Changed[INPUTS];
1110  DATA8 Output[INPUTS][IIC_DATA_LENGTH];
1111  DATA8 OutputLength[INPUTS];
1112 }
1113 IIC;
1114 
1115 /*\endverbatim
1116  *
1117  * \n
1118  */
1119 
1120 
1121 #define IIC_PORT_CHANGED 0x01
1122 #define IIC_DATA_READY 0x08
1123 #define IIC_WRITE_REQUEST 0x10
1124 
1125 
1126 typedef struct
1127 {
1131 }
1132 IICCTL;
1133 
1134 
1135 typedef struct
1136 {
1137  RESULT Result;
1142  DATA8 WrData[IIC_DATA_LENGTH];
1144  DATA8 RdData[IIC_DATA_LENGTH];
1145 }
1146 IICDAT;
1147 
1148 
1149 typedef struct
1150 {
1155  DATA8 Manufacturer[IIC_NAME_LENGTH + 1];
1156  DATA8 SensorType[IIC_NAME_LENGTH + 1];
1162 }
1163 IICSTR;
1164 
1165 
1166 #define IIC_SET_CONN _IOWR('i',2,DEVCON)
1167 #define IIC_READ_TYPE_INFO _IOWR('i',3,IICCTL)
1168 #define IIC_SETUP _IOWR('i',5,IICDAT)
1169 #define IIC_SET _IOWR('i',6,IICSTR)
1170 
1171 
1172 
1173 
1174 #define TST_PIN_LENGTH 8
1175 
1176 typedef struct
1177 {
1181 }
1182 TSTPIN;
1183 
1184 #define TST_PIN_ON _IOWR('t',1,TSTPIN)
1185 #define TST_PIN_OFF _IOWR('t',2,TSTPIN)
1186 #define TST_PIN_READ _IOWR('t',3,TSTPIN)
1187 #define TST_PIN_WRITE _IOWR('t',4,TSTPIN)
1188 
1189 
1190 
1191 
1192 #define TST_UART_LENGTH UART_BUFFER_SIZE
1193 
1194 typedef struct
1195 {
1200 }
1201 TSTUART;
1202 
1203 #define TST_UART_ON _IOWR('t',5,TSTUART)
1204 #define TST_UART_OFF _IOWR('t',6,TSTUART)
1205 #define TST_UART_EN _IOWR('t',7,TSTUART)
1206 #define TST_UART_DIS _IOWR('t',8,TSTUART)
1207 #define TST_UART_READ _IOWR('t',9,TSTUART)
1208 #define TST_UART_WRITE _IOWR('t',10,TSTUART)
1209 
1210 
1211 
1212 
1225 typedef struct
1226 {
1227  DATA8 Pressed[BUTTONS];
1228 }
1229 UI;
1230 
1231 /*\endverbatim
1232  *
1233  * \n
1234  */
1235 
1236 
1237 #define LCD_BUFFER_SIZE (((LCD_WIDTH + 7) / 8) * LCD_HEIGHT)
1238 #define LCD_TOPLINE_SIZE (((LCD_WIDTH + 7) / 8) * (TOPLINE_HEIGHT + 1))
1239 
1240 
1253 typedef struct
1254 {
1255  UBYTE Lcd[LCD_BUFFER_SIZE];
1256 }
1257 LCD;
1258 
1259 /*\endverbatim
1260  *
1261  * \n
1262  */
1263 
1264 
1277 typedef struct
1278 {
1279  DATA8 Status;
1280 }
1281 SOUND;
1282 
1283 /*\endverbatim
1284  *
1285  * \n
1286  */
1287 
1288 
1301 enum {
1302  FULL_SPEED,
1303  HIGH_SPEED
1304  };
1305 
1306 typedef struct
1307 {
1308  DATA8 Speed;
1309 }
1310 USB_SPEED;
1311 
1312 /*\endverbatim
1313  *
1314  * \n
1315  */
1316 
1328 typedef struct
1329 {
1330  DATA8 VolumePercent;
1331  DATA8 SleepMinutes;
1332 }
1333 NONVOL;
1334 
1335 /*\endverbatim
1336  *
1337  * \n
1338  */
1339 
1340 
1341 /*
1342  * Motor/OUTPUT Typedef
1343  */
1344 typedef struct
1345 {
1349 }MOTORDATA;
1350 
1351 typedef struct
1352 {
1360 } STEPPOWER;
1361 
1362 typedef struct
1363 {
1371 } TIMEPOWER;
1372 
1373 typedef struct
1374 {
1382 } STEPSPEED;
1383 
1384 typedef struct
1385 {
1393 } TIMESPEED;
1394 
1395 typedef struct
1396 {
1403 } STEPSYNC;
1404 
1405 typedef struct
1406 {
1413 } TIMESYNC;
1414 /*
1415  * End of Motor/OUTPUT Typedef
1416  */
1417 
1418 
1419 #define PRINTBUFFERSIZE 160
1420 
1421 typedef struct
1422 {
1423  NONVOL NonVol;
1424  DATA8 FirstProgram[MAX_FILENAME_SIZE];
1425 
1426  char PrintBuffer[PRINTBUFFERSIZE + 1];
1428 
1431  PRG Program[MAX_PROGRAMS];
1432 
1433 
1439 
1444 
1450 
1453 
1455 
1457 
1459 
1461 
1465 #ifdef ENABLE_PERFORMANCE_TEST
1466  ULONG PerformTimer;
1467  DATAF PerformTime;
1468 #endif
1469 
1472 
1475 
1476  ERR Errors[ERROR_BUFFER_SIZE];
1479 
1483 
1484 #ifndef DISABLE_SDCARD_SUPPORT
1489 #endif
1490 
1491 #ifndef DISABLE_USBSTICK_SUPPORT
1492  DATA32 UsbstickSize;
1493  DATA32 UsbstickFree;
1494  ULONG UsbstickTimer;
1495  DATA8 UsbstickOk;
1496 #endif
1497 
1500 
1501  ANALOG Analog;
1502  ANALOG *pAnalog;
1503  int AdcFile;
1504 
1505 #ifdef ENABLE_STATUS_TEST
1506  DATA8 Status;
1507 #endif
1508 
1509 #if (HARDWARE == SIMULATION)
1510  class NXT * nxt;
1511 #endif
1512 }GLOBALS;
1513 
1514 
1515 #if (HARDWARE == SIMULATION)
1516  extern GLOBALS * gInstance;
1517  #define VMInstance (*gInstance)
1518  RESULT mSchedInit();
1519  RESULT mSchedCtrl();
1520  RESULT mSchedExit();
1521 
1522  void setInstance(GLOBALS * _Instance);
1523  GLOBALS * getInstance();
1524 #else
1525  extern GLOBALS VMInstance;
1526 #endif
1527 
1528 
1529 #endif /* LMS2012_H_ */
Device is NXT sound sensor.
Definition: lms2012.h:568
DATA32 MemorySize
Definition: lms2012.h:1480
DATA32 Bitrate
Definition: lms2012.h:1196
DATA8 GetVolumePercent(void)
Definition: lms2012.c:378
#define CALPOINTS
Definition: lms2012.h:930
DATAF PctMin
Percent minimum value (e.c. -100.0)
Definition: lms2012.h:787
DATA32 SdcardSize
Definition: lms2012.h:1485
RESULT Result
Program result (OK, BUSY, FAIL)
Definition: lms2012.h:755
RESULT Result
Definition: lms2012.h:1137
DATA8 Port
Definition: lms2012.h:1178
DATA8 Port
Definition: lms2012.h:1197
#define TYPE_NAME_LENGTH
Definition: lms2012.h:768
#define OP(a, b, c, d, s, T)
DATA8 Changed[INPUTS][MAX_DEVICE_MODES]
Definition: d_uart_mod.c:1953
DATA8 Format
Definition: lms2012.h:781
Definition: lms2012.h:558
SLONG TachoSensor
Definition: lms2012.h:1348
ULONG IMINDEX
ImageData index type.
Definition: lmstypes.h:78
GP pGlobal
Pointer to start of global bytes.
Definition: lms2012.h:1436
void(* PRIM)(void)
Prototype for all byte codes.
Definition: lms2012.h:678
UWORD IdValue
Device id value (e.c. 0 ~ UART)
Definition: lms2012.h:792
DATA8 Type
Device type.
Definition: lms2012.h:777
signed char SBYTE
Basic Type used to symbolise 8 bit signed values.
Definition: lmstypes.h:33
IP pImage
Pointer to start of image.
Definition: lms2012.h:742
LCD LcdBuffer
Copy of last LCD update.
Definition: lms2012.h:1498
UBYTE VARDATA
Variable base type.
Definition: lmstypes.h:68
void SetVolumePercent(DATA8 Volume)
Definition: lms2012.c:372
DATA32 Time2
Definition: lms2012.h:1368
OBJHEAD * pObjHead
Pointer to start of object headers.
Definition: lms2012.h:1437
Break because of fail.
Definition: lms2012.h:674
void SetSleepMinutes(DATA8 Minutes)
Definition: lms2012.c:384
long TimerDatanSec
Definition: lms2012.h:1452
SWORD DATA16
VM Type for 2 byte signed value.
Definition: lmstypes.h:62
GLOBALS VMInstance
Definition: lms2012.c:131
OBJSTAT ProgramStatus(PRGID PrgId)
Get program status.
Definition: lms2012.c:218
OBJID ObjectId
Active object id.
Definition: lms2012.h:751
IP GetObjectIp(void)
Get current instruction pointer.
Definition: lms2012.c:298
DATA8 Power
Definition: lms2012.h:1366
DATA8 Repeat
Definition: lms2012.h:1139
SLONG DATA32
VM Type for 4 byte signed value.
Definition: lmstypes.h:63
DATA16 Time
Definition: lms2012.h:1140
DATA8 GetTerminalEnable(void)
Definition: lms2012.c:354
OBJSTAT StatusChange
Program status change.
Definition: lms2012.h:754
DATA8 LcdUpdated
LCD updated.
Definition: lms2012.h:1499
DATA8 RdLng
Definition: lms2012.h:1143
DATA8 CheckUsbstick(DATA8 *pChanged, DATA32 *pTotal, DATA32 *pFree, DATA8 Force)
Definition: lms2012.c:1959
TYPES TypeData
Definition: lms2012.h:1069
ULONG GetTimeMS(void)
Definition: lms2012.c:321
DATA16 Time
Definition: lms2012.h:1152
void PrimParAdvance(void)
Skip next encoded parameter from byte code stream.
Definition: lms2012.c:870
UWORD OBJID
Object id type.
Definition: lmstypes.h:73
void * VmMemoryResize(HANDLER Handle, DATA32 Elements)
Definition: lms2012.c:366
UBYTE Blocked
Definition: lms2012.h:707
Definition: lms2012.h:724
void LogErrorNumber(ERR Error)
Definition: lms2012.c:445
OP OpCode
Saved substituted opcode.
Definition: lms2012.h:727
int AdcFile
Definition: lms2012.h:1503
DATA8 Length
Definition: lms2012.h:1198
DATA8 LogErrorNumberExists(ERR Error)
Definition: lms2012.c:470
Port empty or not available.
Definition: lms2012.h:585
DATA8 Port
Definition: lms2012.h:1070
ULONG GetTime(void)
Definition: lms2012.c:315
DATA8 Mode
Device mode.
Definition: lms2012.h:779
UWORD RefCount
Definition: lms2012.h:1458
DATA8 Decimals
Definition: lms2012.h:783
DATA8 Brake
Definition: lms2012.h:1412
DATA16 Turn
Definition: lms2012.h:1410
ULONG GetTimeUS(void)
Definition: lms2012.c:327
DATA16 HANDLER
Memory list index.
Definition: lmstypes.h:85
RESULT mSchedExit(void)
Definition: lms2012.c:2513
DATA8 TerminalEnabled
Definition: lms2012.h:1427
UBYTE ObjStatus
Object status.
Definition: lms2012.h:706
ULONG Priority
Object priority.
Definition: lms2012.h:1471
#define TST_UART_LENGTH
Definition: lms2012.h:1192
Definition: lms2012.h:557
DATA8 Figures
Definition: lms2012.h:782
PRGID FavouritePrg
Definition: lms2012.h:1429
DATA32 Time
Definition: lms2012.h:1411
UWORD Debug
Debug flag.
Definition: lms2012.h:760
GP pData
Pointer to start of data.
Definition: lms2012.h:743
ULONG RunTime
Program run time [uS].
Definition: lms2012.h:740
OBJHEAD * pObjHead
Pointer to start of object headers.
Definition: lms2012.h:745
Break because of user decision.
Definition: lms2012.h:673
DATA32 Time1
Definition: lms2012.h:1389
ULONG Value
Definition: lms2012.h:1473
DSPSTAT DispatchStatus
Dispatch status.
Definition: lms2012.h:1470
void VmPrint(char *pString)
Definition: lms2012.c:339
GP ObjGlobalSave
Definition: lms2012.h:1446
Break because of opcode break.
Definition: lms2012.h:670
DATA8 Speed
Definition: lms2012.h:1399
DATA8 Nos
Definition: lms2012.h:1354
UBYTE ErrorIn
Definition: lms2012.h:1477
Break because of program stop.
Definition: lms2012.h:668
DATA32 Time3
Definition: lms2012.h:1369
DSPSTAT DispatchStatusSave
Definition: lms2012.h:1448
Device is a NXT ADC test sensor.
Definition: lms2012.h:580
ULONG InstrCnt
Instruction counter (performance test)
Definition: lms2012.h:1434
DATA32 MemoryFree
Definition: lms2012.h:1481
DATAF SiMin
SI unit minimum value (e.c. -100.0)
Definition: lms2012.h:789
IP Ip
Object instruction pointer.
Definition: lms2012.h:703
void SetInstructions(ULONG Instructions)
Set instructions.
Definition: lms2012.c:273
Port not empty but type has not been determined.
Definition: lms2012.h:584
char * String
Definition: tistdtypes.h:55
DATA8 Power
Definition: lms2012.h:1355
OBJID Objects
No of objects in image.
Definition: lms2012.h:1442
DATA32 SdcardFree
Definition: lms2012.h:1486
UWORD TRIGGER
TriggerCount type.
Definition: lmstypes.h:81
DATA8 Speed
Definition: lms2012.h:1377
DATA8 Speed
Definition: lms2012.h:1409
IMGDATA * IP
Instruction pointer type.
Definition: lmstypes.h:74
Definition: lms2012.h:774
DATA8 Cmd
Definition: lms2012.h:1353
void ProgramEnd(PRGID PrgId)
Exit program nicely (freeing up memory)
Definition: lms2012.c:1555
ULONG PollString
Definition: lms2012.h:1160
DATAF RawMax
Raw maximum value (e.c. 1023.0)
Definition: lms2012.h:786
DATA8 Pins
Device pin setup.
Definition: lms2012.h:793
void SetTerminalEnable(DATA8 Value)
Definition: lms2012.c:348
DATAF SiMax
SI unit maximum value (e.c. 100.0)
Definition: lms2012.h:790
unsigned int ULONG
Basic Type used to symbolise 32 bit unsigned values.
Definition: lmstypes.h:31
DATA8 Brake
Definition: lms2012.h:1370
ULONG InstrCnt
Instruction counter used for performance analyses.
Definition: lms2012.h:736
DSPSTAT ExecuteByteCode(IP pByteCode, GP pGlobals, LP pLocals)
Execute byte code stream (C-call)
Definition: lms2012.c:535
ULONG OldTime2
Definition: lms2012.h:1463
TYPES TypeData[INPUTS][MAX_DEVICE_MODES]
TypeData.
Definition: d_uart_mod.c:1952
IP GetImageStart(void)
Get pointer to actual start of byte code image.
Definition: lms2012.c:245
UWORD Align
Definition: lms2012.h:795
LP pLocal
Local variable pointer.
Definition: lms2012.h:704
ULONG StartTime
Program start time [mS].
Definition: lms2012.h:739
Device is NXT light sensor.
Definition: lms2012.h:567
DATA16 Turn
Definition: lms2012.h:1400
RESULT mSchedInit(int argc, char *argv[])
Definition: lms2012.c:2063
DATA8 Nos
Definition: lms2012.h:1365
Definition: lms2012.h:734
LP ObjLocalSave
Definition: lms2012.h:1447
OBJID CallingObjectId(void)
Get calling object id.
Definition: lms2012.c:196
DATA8 Brake
Definition: lms2012.h:1402
void AdjustObjectIp(IMOFFS Value)
Adjust current instruction pointer.
Definition: lms2012.c:287
#define SYMBOL_LENGTH
Symbol leng th (not including zero)
Definition: lms2012.h:769
RESULT ValidateString(DATA8 *pString, DATA8 Set)
Definition: lms2012.c:5694
void * PrimParPointer(void)
Get next encoded parameter from byte code stream.
Definition: lms2012.c:694
DATA8 Mode
Definition: lms2012.h:1130
Break because of program break.
Definition: lms2012.h:672
DATA8 Connection
Definition: lms2012.h:778
SLONG TachoCounts
Definition: lms2012.h:1346
DATA8 SdcardOk
Definition: lms2012.h:1488
DATA32 Step2
Definition: lms2012.h:1357
ANALOG Analog
Definition: lms2012.h:1501
Port not empty and type is invalid.
Definition: lms2012.h:586
SBYTE Speed
Definition: lms2012.h:1347
DATA32 Step3
Definition: lms2012.h:1358
TRIGGER TriggerCount
Trigger count used by BLOCK's trigger logic.
Definition: lms2012.h:714
OBJID CallerId
Caller id used for SUBCALL to save object id to return to.
Definition: lms2012.h:713
ULONG TimeuS
Definition: lms2012.h:1460
ULONG CurrentObjectIp(void)
Definition: lms2012.c:333
void GetResourcePath(char *pString, DATA8 MaxLength)
Definition: lms2012.c:360
ULONG InstrTime
Instruction time used for performance analyses.
Definition: lms2012.h:737
ULONG OldTime1
Definition: lms2012.h:1462
#define PRINTBUFFERSIZE
Definition: lms2012.h:1419
DATA8 Brake
Definition: lms2012.h:1392
DATA8 Mode
Definition: lms2012.h:1154
Device is a tacho motor.
Definition: lms2012.h:571
SLONG IMOFFS
ImageData offset type.
Definition: lmstypes.h:83
DATA8 Views
Definition: lms2012.h:784
Device is NXT IIC sensor.
Definition: lms2012.h:582
OBJ ** pObjList
Pointer to object pointer list.
Definition: lms2012.h:746
DATA8 Cmd
Definition: lms2012.h:1397
DATA8 DataSets
Definition: lms2012.h:780
DATA8 CheckSdcard(DATA8 *pChanged, DATA32 *pTotal, DATA32 *pFree, DATA8 Force)
Definition: lms2012.c:1855
ULONG SetupString
Definition: lms2012.h:1158
DATA8 PollLng
Definition: lms2012.h:1159
DATA8 Nos
Definition: lms2012.h:1376
RESULT ValidateChar(DATA8 *pChar, DATA8 Set)
Definition: lms2012.c:5680
NONVOL NonVol
Definition: lms2012.h:1423
unsigned char UBYTE
Basic Type used to symbolise 8 bit unsigned values.
Definition: lmstypes.h:29
Port is connected to a terminal.
Definition: lms2012.h:583
DATA8 GetSleepMinutes(void)
Definition: lms2012.c:390
DATA8 Type
Definition: lms2012.h:1153
#define BUTTONS
Number of buttons in the system.
Definition: lms2012.h:193
DATA8 Brake
Definition: lms2012.h:1381
DATA8 Cmd
Definition: lms2012.h:1407
HANDLER Handle
Definition: lms2012.h:1474
DATA8 ReadLng
Definition: lms2012.h:1161
FLOAT DATAF
VM Type for 4 byte floating point value.
Definition: lmstypes.h:64
ULONG MemoryTimer
Definition: lms2012.h:1482
VARDATA * LP
Local variable pointer type.
Definition: lmstypes.h:75
UBYTE ErrorOut
Definition: lms2012.h:1478
DATA32 Time1
Definition: lms2012.h:1367
unsigned short UWORD
Basic Type used to symbolise 16 bit unsigned values.
Definition: lmstypes.h:30
DATA8 Length
Definition: lms2012.h:1179
DATA8 Port
Definition: lms2012.h:1138
#define OUTPUTS
Number of output ports in the system.
Definition: lms2012.h:191
IP ObjectIp
Working object Ip.
Definition: lms2012.h:1440
DATAF RawMin
Raw minimum value (e.c. 0.0)
Definition: lms2012.h:785
DATA8 Cmd
Definition: lms2012.h:1386
DATA8 Nos
Definition: lms2012.h:1398
DATA32 Step1
Definition: lms2012.h:1356
GP pGlobal
Pointer to start of global bytes.
Definition: lms2012.h:744
UWORD InvalidTime
mS from type change to valid data
Definition: lms2012.h:791
Definition: lms2012.h:701
IP ObjIpSave
Definition: lms2012.h:1445
#define LCD_BUFFER_SIZE
Definition: lms2012.h:1237
DATA32 Time2
Definition: lms2012.h:1390
DATA8 Cmd
Definition: lms2012.h:1364
DATA32 Step2
Definition: lms2012.h:1379
Device is a mini tacho motor.
Definition: lms2012.h:572
UWORD Debug
Definition: lms2012.h:1454
PRGID CurrentProgramId(void)
Get current program id.
Definition: lms2012.c:207
UWORD Test
Definition: lms2012.h:1456
UWORD PRGID
Program id type.
Definition: lmstypes.h:71
long TimerDataSec
Definition: lms2012.h:1451
void SetObjectIp(IP Ip)
Set current instruction pointer.
Definition: lms2012.c:309
DATA8 Port
Definition: lms2012.h:1151
IP pImage
Pointer to start of image.
Definition: lms2012.h:1435
DATA32 Step1
Definition: lms2012.h:1378
OBJ ** pObjList
Pointer to object pointer list.
Definition: lms2012.h:1438
DATA8 Speed
Definition: lms2012.h:1388
DATA8 Brake
Definition: lms2012.h:1359
void SetUiUpdate(void)
Definition: lms2012.c:396
LP ObjectLocal
Working object locals.
Definition: lms2012.h:1441
SBYTE DATA8
VM Type for 1 byte signed value.
Definition: lmstypes.h:61
DATA8 WrLng
Definition: lms2012.h:1141
DATA8 SetupLng
Definition: lms2012.h:1157
IP ObjectIp
Working object Ip.
Definition: lms2012.h:747
Device is NXT color sensor.
Definition: lms2012.h:569
IMINDEX Addr
Offset to breakpoint address from image start.
Definition: lms2012.h:726
Break because of sleeping.
Definition: lms2012.h:669
OBJID Objects
No of objects in image.
Definition: lms2012.h:750
OBJID ObjectId
Active object id.
Definition: lms2012.h:1443
DATA8 Mode
Definition: lms2012.h:1071
Device is a new tacho motor.
Definition: lms2012.h:573
DATA8 Nos
Definition: lms2012.h:1387
ANALOG * pAnalog
Definition: lms2012.h:1502
OBJSTAT ProgramStatusChange(PRGID PrgId)
Get program status change.
Definition: lms2012.c:229
RESULT mSchedCtrl(UBYTE *pRestart)
Definition: lms2012.c:2296
void SetDispatchStatus(DSPSTAT Status)
Set object (dispatch) status.
Definition: lms2012.c:256
DATA8 Port
Definition: lms2012.h:1129
DSPSTAT
Definition: lms2012.h:665
OBJSTAT Status
Program status.
Definition: lms2012.h:753
ULONG PrioritySave
Definition: lms2012.h:1449
#define INPUTS
Number of input ports in the system.
Definition: lms2012.h:192
ERR
Definition: lms2012.h:807
DATA8 Cmd
Definition: lms2012.h:1375
TYPE
Definition: lms2012.h:563
DATA8 Nos
Definition: lms2012.h:1408
void Error(void)
opOUTPUT_READY byte code
Definition: lms2012.c:2839
VARDATA * GP
global variable pointer type
Definition: lmstypes.h:76
Break because of waiting for completion.
Definition: lms2012.h:671
DATA32 Step
Definition: lms2012.h:1401
#define MAX_LABELS
Max number of labels per program.
Definition: bytecodes.c:24
OBJSTAT
Definition: bytecodes.h:1513
Dispatcher running (looping)
Definition: lms2012.h:667
PRGID ProgramId
Program id running.
Definition: lms2012.h:1430
#define COLORS
Definition: lms2012.h:929
#define TST_PIN_LENGTH
Definition: lms2012.h:1174
DATAF PctMax
Percent maximum value (e.c. 100.0)
Definition: lms2012.h:788
TYPES TypeData
Definition: lms2012.h:1128
ULONG SdcardTimer
Definition: lms2012.h:1487
DATA32 Time3
Definition: lms2012.h:1391
Device is NXT touch sensor.
Definition: lms2012.h:566
signed int SLONG
Basic Type used to symbolise 32 bit signed values.
Definition: lmstypes.h:35
LP ObjectLocal
Working object locals.
Definition: lms2012.h:748
ULONG NewTime
Definition: lms2012.h:1464
DATA32 Step3
Definition: lms2012.h:1380
ERR LogErrorGet(void)
Definition: lms2012.c:495