00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef FEMTOOS_GLOBALS_H
00026 #define FEMTOOS_GLOBALS_H
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include <avr/io.h>
00037
00038
00039
00040
00041 #ifndef __ASSEMBLER__
00042 #include <avr/pgmspace.h>
00043 #include <string.h>
00044 #endif
00045
00049 #define SystemID "FemtoOS 0.91"
00050
00054 #define true 1
00055 #define false 0
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #define Tchar unsigned char
00069 #define Tbool Tuint08
00070 #define Taddress Tchar *
00071 #define Tbyte uint8_t
00072 #define Tword uint16_t
00073 #define Tsint08 int8_t
00074 #define Tuint08 uint8_t
00075 #define Tsint16 int16_t
00076 #define Tuint16 uint16_t
00077 #define Tdouble double
00078 #define Tenum uint8_t
00079
00080
00089 #define defDelayTimeMax 0xFEFF
00090
00098 #define defDelayTimeZero 0x0000
00099
00106 #define defLockBlockInfinite 0x0000
00107
00115 #define defLockDoNotBlock 0x0001
00116
00126 #define defStackInitByte 0x00
00127
00140 #define defCurrentTaskNumber 0x80
00141
00154 #define defCurrentTaskName defCurrentTaskName
00155
00163 #define defFromFileStart 0x00
00164
00173 #define defFromFileEnd 0xFF
00174
00183 #define defUntilFileEnd 0xFF
00184
00193 #define defReadOnly 0x01
00194
00203 #define defReadWrite 0x00
00204
00211 #define defAllEvents 0xFF
00212
00225 #define defRestartSuspended 0x00
00226
00240 #define defRestartSleeping 0x40
00241
00252 #define defRestartDefault 0x80
00253
00254
00260 #define defRestartShared 0x80
00261
00271 #define defRestartRunning 0xC0
00272
00273
00281 #define defSuspendNow 0x01
00282
00290 #define defSuspendCheck 0x02
00291
00298 #define defSuspendClear 0x04
00299
00300
00327 #define errUnused_0x00 0x00
00328
00346 #define errInsufficientCapabilities 0x01
00347
00351 #define errUnused_0x02 0x02
00352
00363 #define errTaskStackWillOverflow 0x03
00364
00389 #define errTaskIllegalRegisterUse 0x04
00390
00402 #define errTaskTakesTooLong 0x05
00403
00414 #define errTaskNestingOverflowed 0x06
00415
00426 #define errTaskNestingUnderflowed 0x07
00427
00436 #define errTaskNestingPresent 0x08
00437
00441 #define errUnused_0x09 0x09
00442
00451 #define errTaskHoldsNoSlots 0x0A
00452
00462 #define errSlotDoubleUsed 0x0B
00463
00474 #define errQueuOverrun 0x0C
00475
00486 #define errQueuUnderrun 0x0D
00487
00497 #define errTaskPriorityTooHigh 0x0E
00498
00511 #define errTaskDelayTooLong 0x0F
00512
00525 #define errTaskDelayTooShort 0x10
00526
00536 #define errSlotZeroUsed 0x11
00537
00546 #define errSlotTypeMismatch 0x12
00547
00556 #define errSlotTwins 0x13
00557
00567 #define errIllegalDominantState 0x14
00568
00579 #define errQueuWriteLimit 0x15
00580
00591 #define errQueuReadLimit 0x16
00592
00602 #define errSlotDecreaseFail 0x17
00603
00613 #define errSlotIncreaseFail 0x18
00614
00624 #define errFileOpenMode 0x19
00625
00636 #define errFileInvalidFileNumber 0x1A
00637
00647 #define errFileOutOfRange 0x1B
00648
00658 #define errFileClosedMode 0x1C
00659
00671 #define errFileWrongMode 0x1D
00672
00681 #define errInvalidRestartMode 0x1E
00682
00691 #define errInvalidSuspendMode 0x1F
00692
00693
00701 #define fatInternalError 0x20
00702
00712 #define fatOsStackUnderMinimum 0x21
00713
00723 #define fatOsStackOverflowed 0x22
00724
00734 #define fatIllegalEvent 0x23
00735
00746 #define fatTaskStackOverflowed 0x24
00747
00757 #define fatIsrStackOverflowed 0x25
00758
00769 #define fatOsTickRateTooHigh 0x26
00770
00780 #define fatTaskSubtickOverflow 0x27
00781
00792 #define fatTaskIllegalTaskNumber 0x28
00793
00797 #define fatUnused_0x29 0x29
00798
00807 #define fatIllegalCallfromISR 0x2A
00808
00812 #define fatUnused_0x2B 0x2B
00813
00817 #define fatUnused_0x2C 0x2C
00818
00822 #define fatUnused_0x2D 0x2D
00823
00827 #define fatUnused_0x2E 0x2E
00828
00832 #define fatUnused_0x2F 0x2F
00833
00834
00838 #define traceNull 0x00
00839 #define traceMarker 0x01
00840 #define traceUserByteMessage 0x02
00841 #define traceUserWordMessage 0x03
00842 #define traceTaskStart 0x10
00843 #define traceOsStart 0x20
00844 #define traceIdleStart 0x21
00845 #define traceSleepStart 0x22
00846 #define traceTickInterrupt 0x23
00847 #define traceWatchdog 0x24
00848 #define traceLockAcquire 0x25
00849 #define traceLockReject 0x26
00850 #define traceReset 0x27
00851 #define traceISR 0x28
00852 #define traceSlotLock 0x30
00853 #define traceSlotUnlock 0x40
00854 #define traceFireEvent 0x50
00855 #define traceWatermarks 0x58
00856 #define traceUnused 0x59
00857 #define traceREGISTERLEAK_5A 0x5A
00858 #define traceBurnLock 0x5B
00859 #define traceBurnFree 0x5C
00860 #define traceCreateContext 0x5D
00861 #define traceLoadInfo 0x5E
00862 #define traceOsTime 0x5F
00863 #define traceTaskInit 0x60
00864 #define traceTaskRelease 0x70
00865 #define traceAPIcallBase 0x80
00866 #define traceAPIcall1 0x90
00867 #define traceAPIcall2 0xA0
00868 #define traceAPIcall3 0xB0
00869 #define traceAPIcall4 0xC0
00870 #define traceErrorBase 0xD0
00871 #define traceError1 0xE0
00872 #define traceError2 0xF0
00873
00877 #define callIdSystem 0x00
00878 #define callIdTaskYield 0x01
00879 #define callIdTaskWaitForEvent 0x02
00880 #define callIdTaskDelayFromNow 0x03
00881 #define callIdTaskDelayFromWake 0x04
00882 #define callIdTaskSuspend 0x05
00883 #define callIdTaskSleep 0x06
00884 #define callIdTaskSleepAll 0x07
00885 #define callIdTaskRecreate 0x08
00886 #define callIdTaskFeedWatchdog 0x09
00887 #define callIdTaskKillWatchdog 0x0A
00888 #define callIdTaskRestart 0x0B
00889 #define callIdTaskTerminate 0x0C
00890 #define callIdTaskEnableGlobalInterrupts 0x0D
00891 #define callIdTaskDisableGlobalInterrupts 0x0E
00892 #define callIdTaskEnableTickInterrupts 0x0F
00893 #define callIdTaskDisableTickInterrupts 0x10
00894 #define callIdTaskEnableSwitchTask 0x11
00895 #define callIdTaskDisableSwitchTask 0x12
00896 #define callIdTaskEnterGlobalCritical 0x13
00897 #define callIdTaskExitGlobalCritical 0x14
00898 #define callIdTaskEnterTickCritical 0x15
00899 #define callIdTaskExitTickCritical 0x16
00900 #define callIdTaskEnterSwitchCritical 0x17
00901 #define callIdTaskExitSwitchCritical 0x18
00902 #define callIdTaskFileOpen 0x19
00903 #define callIdTaskFileClose 0x1A
00904 #define callIdTaskFileFormat 0x1B
00905 #define callIdTaskFileGetSize 0x1C
00906 #define callIdTaskFileSetSize 0x1D
00907 #define callIdTaskFileReadByte 0x1E
00908 #define callIdTaskFileWriteByte 0x1F
00909 #define callIdTaskFileAppendByte 0x20
00910 #define callIdTaskFileReadPipe 0x21
00911 #define callIdTaskFileWritePipe 0x22
00912 #define callIdTaskFileReadBuffer 0x23
00913 #define callIdTaskFileWriteBuffer 0x24
00914 #define callIdREGISTERLEAK_A5 0x25
00915 #define callIdTaskWaitForTasks 0x26
00916 #define callIdTaskSyncRequest 0x27
00917 #define callIdTaskSyncRelease 0x28
00918 #define callIdTaskMemMalloc 0x29
00919 #define callIdTaskMemFree 0x2A
00920 #define callIdTaskMemDefrag 0x2B
00921 #define callIdTaskMemPointer 0x2C
00922 #define callIdTaskReserved1 0x2D
00923 #define callIdTaskReserved2 0x2E
00924 #define callIdTaskReserved3 0x2F
00925 #define callIdTaskReserved4 0x30
00926 #define callIdTaskReserved5 0x31
00927 #define callIdTaskReserved6 0x32
00928 #define callIdGenSuspend 0x33
00929 #define callIdGenResume 0x34
00930 #define callIdGenSetPriority 0x35
00931 #define callIdGenGetPriority 0x36
00932 #define callIdGenGetTickCount 0x37
00933 #define callIdGenGetLastWakeTime 0x38
00934 #define callIdGenGetTaskname 0x39
00935 #define callIdGenFireEventSet 0x3A
00936 #define callIdGenReboot 0x3B
00937 #define callIdGenLogTask 0x3C
00938 #define callIdGenLogOs 0x3D
00939 #define callIdGenWaitRelease 0x3E
00940 #define callIdGenQueuWrite 0x3F
00941 #define callIdGenQueuRead 0x40
00942 #define callIdGenQueuPeek 0x41
00943 #define callIdGenQueuReadable 0x42
00944 #define callIdGenQueuWriteable 0x43
00945 #define callIdGenQueuFull 0x44
00946 #define callIdGenQueuEmpty 0x45
00947 #define callIdGenQueuClear 0x46
00948 #define callIdGenAddtoTickCount 0x47
00949 #define callIdGenPassFlashString 0x48
00950 #define callIdGenCountEventBlocks 0x49
00951 #define callIdGenReserved1 0x4A
00952 #define callIdGenReserved2 0x4B
00953 #define callIdGenReserved3 0x4C
00954 #define callIdGenReserved4 0x4D
00955 #define callIdGenReserved5 0x4E
00956 #define callIdGenReserved6 0x4F
00961 #define callIdTaskStackCheck ----
00962 #define callIdGenPipeInt16 ----
00963 #define callIdGenTraceByteInfo ----
00964 #define callIdGenTraceWordInfo ----
00965 #define callIdGenTraceMarker ----
00966 #define callIdTaskMutexRequestOnName 0x27
00967 #define callIdTaskMutexReleaseOnName 0x27
00968 #define callIdTaskQueuWriteRequestOnName 0x27
00969 #define callIdTaskQueuReadRequestOnName 0x27
00970 #define callIdTaskQueuReleaseOnName 0x28
00971 #define callIdTaskSyncReleaseOnName 0x28
00972 #define callIdTaskSyncWriteWriteRequestOnName 0x27
00973 #define callIdTaskSyncWriteReadRequestOnName 0x27
00974 #define callIdTaskSyncReadWriteRequestOnName 0x27
00975 #define callIdTaskSyncReadReadRequestOnName 0x27
00976 #define callIdTaskWaitForOtherTask 0x26
00977 #define callIdIsrBegin ----
00978 #define callIdIsrEndReturn ----
00979 #define callIdIsrEndYield ----
00980 #define callIdIsrEnter ----
00981 #define callIdIsrExit ----
00982 #define callIdIsrStackCheck ----
00983 #define callIdIsrStartLoad ----
00984 #define callIdIsrStopLoad ----
00985 #define callIdIsrFireEvent ----
00986 #define callIdGenFireEvent ----
00987 #define callIdTaskFileClear 0x1D
00988 #define callIdTaskFileDirectRead ----
00989 #define callIdTaskFileDirectWrite ----
00998 #define defResponseOK 0x01
00999 #define defResponseUnknownCommand 0x02
01000 #define defResponseError 0x03
01001 #define defResponseInvalidTask 0x04
01002 #define defResponseInvalidPriority 0x05
01003 #define defResponseFemtoOs 0x10
01004 #define defResponseLogTask 0x11
01005 #define defResponseLogOs 0x12
01006 #define defResponseTickCount 0x13
01007 #define defResponseDump 0x14
01008 #define defResponseUptime 0x15
01009 #define defResponseFile 0x16
01010 #define defResponseInvalidFileNumber 0x17
01011
01012 #define defRequestFemtoOs 0x90
01013 #define defRequestProcessList 0x91
01014 #define defRequestTickCount 0x93
01015 #define defRequestReboot 0x94
01016 #define defRequestSuspend 0x95
01017 #define defRequestResume 0x96
01018 #define defRequestTerminate 0x97
01019 #define defRequestPriority 0x98
01020 #define defRequestRecreate 0x99
01021 #define defRequestDump 0x9A
01022 #define defRequestStore 0x9B
01023 #define defRequestRecall 0x9C
01024 #define defRequestUptime 0x9D
01025 #define defRequestTest 0x9E
01026
01027 #define defDumpRAM 0x01
01028 #define defDumpEEPROM 0x02
01029 #define defDumpFLASH 0x03
01030
01031 #endif