Choco OS  V.0.16.9.0
Join to the chocolate world
oc_errors.h
1 
30 #ifndef SYSTEM_GEN_OC_ERRORS_H_
31 #define SYSTEM_GEN_OC_ERRORS_H_
32 
33 /*==========================================================================================================================================
34 //
35 // INCLUDES
36 //
37 //========================================================================================================================================*/
38 
39 #include <stdint.h>
40 #include <stdio.h>
41 #include <stdbool.h>
42 #include <oc_1word.h>
43 #include <oc_compiler.h>
44 
45 /*==========================================================================================================================================
46 //
47 // ERROR CODES
48 //
49 //========================================================================================================================================*/
50 
51 
58 #define oC_ERRORS_LIST(ADD) \
59  ADD( AllocationError , "Cannot allocate memory" )\
60  ADD( ReleaseError , "Release memory error" )\
61  ADD( TimeoutError , "Timeout error" )\
62  ADD( ReleasingMutexError , "Releasing mutex error" )\
63  ADD( ChannelNotConfigured, "Channel not configured" )\
64  ADD( ExtiLineIsUsed, "Exti line is used" )\
65  ADD( ParentProcessNotSet, "None of processes contains this thread" )\
66  ADD( ThreadNotSet, "Thread not set" )\
67  ADD( ProhibitedByArchitecture, "Prohibited by architecture" )\
68  ADD( PixelFormatNotCorrect, "Pixel format not correct" )\
69  ADD( PixelFormatNotConfigured, "Pixel format not configured" )\
70  ADD( WrongLayer, "Wrong layer" )\
71  ADD( AddressNotAligned, "Address is not aligned" )\
72  ADD( TestFailed, "Test failed" )\
73  ADD( SyntaxNotCorrect, "Syntax not correct" )\
74  ADD( NoCommandSpecified, "No command specified" )\
75  ADD( OutputBufferTooSmall, "Output buffer is too small" )\
76  ADD( WrongModuleIndex, "Wrong module index" )\
77  ADD( DaemonThreadAlreadyExists, "Daemon thread already exists" )\
78  ADD( LoopbackNotSupported, "Loopback not supported" )\
79  ADD( NotAllSent, "Not all selements sent" )\
80  ADD( CannotFindModulePin, "Cannot find module pin" )\
81  ADD( WrongModulePinChannel, "Wrong module pin channel" )\
82  ADD( ModulePinIsNotGiven, "Module pin is not given" )\
83  ADD( NoneOfModulePinAssigned, "None of module pin assigned to the given pin" )\
84  ADD( DaemonProcessAlreadyExists, "Daemon process already exists" )\
85  ADD( ChipNotDefined, "Chip is not defined" )\
86  ADD( CannotCreateProcess, "Cannot create process" )\
87  ADD( ArrayNotCorrect, "Array not correct" )\
88  ADD( ArraySizeTooBig, "Array size too big" )\
89  ADD( CannotCreateThread, "Cannot create thread" )\
90  ADD( CannotInitializeModule, "Cannot initialize module" )\
91  ADD( NotHandledByFileSystem, "Not handled by file system" )\
92  ADD( CannotRunThread, "Cannot run thread" )\
93  ADD( NotAllPinsInTheSameState, "Not all pins in the same state" )\
94  ADD( FileSystemNotCorrect, "File System not correct" )\
95  ADD( PathAlreadyUsed, "Path already used" )\
96  ADD( DriverContextNotSet, "Driver context not set" )\
97  ADD( StringNotAsExpected, "String is not as expected" )\
98  ADD( SpecifierNotHandled, "Specifier not handled" )\
99  ADD( WrongNumberFormat, "Wrong number format" )\
100  ADD( NoSuchFile, "No such file" )\
101  ADD( FileAlreadyExists, "File already exists" )\
102  ADD( FileIsReadOnly, "File is read only" )\
103  ADD( CannotCreateFile, "Cannot create file" )\
104  ADD( CannotDeleteFile, "Cannot delete file" )\
105  ADD( DirectoryNotExists, "Directory not exists" )\
106  ADD( VoltageNotCorrect, "Voltage is not correct" )\
107  ADD( ExistingFileNotCorrect, "Existing file is not correct" )\
108  ADD( FileIsBusy, "File is busy" )\
109  ADD( FileIsEmpty, "File is empty" )\
110  ADD( EndOfFile, "End of file" )\
111  ADD( FileNotCorrect, "File not correct" )\
112  ADD( NoAllBytesRead, "No all bytes read" )\
113  ADD( OffsetTooBig, "Offset too big" )\
114  ADD( ModeNotCorrect, "Mode not correct" )\
115  ADD( DigitBaseNotCorrect, "Digit base is not correct" )\
116  ADD( StreamTypeNotCorrect , "Stream type is not correct" )\
117  ADD( ProcessNotCorrect , "Process is not correct" )\
118  ADD( RecursiveDriverUsage, "Driver cannot be used in recursive mode" )\
119  ADD( ThreadNotCorrect , "Thread is not correct" )\
120  ADD( WidthTooBig, "Width too big" )\
121  ADD( HeightTooBig, "Height too big" )\
122  ADD( InvertNotSupported, "Invert not supported" )\
123  ADD( DefaultProgramNotSet, "Default program is not set" )\
124  ADD( StreamNotCorrect , "Stream is not correct" )\
125  ADD( ContextNotCorrect , "Context is not correct" )\
126  ADD( CannotDeleteCurrentThread, "Cannot delete current thread" )\
127  ADD( CannotDeleteProcess, "Cannot delete process" )\
128  ADD( ListNotCorrect, "List is not correct" )\
129  ADD( BitOrderNotSupported, "Bit order is not supported" )\
130  ADD( PathNotCorrect, "Path not correct" )\
131  ADD( ParityNotSupported, "Parity is not supported" )\
132  ADD( ParityNotCorrect, "Parity is not correct" )\
133  ADD( StopBitNotSupported, "Stop bit is not supported" )\
134  ADD( Timeout, "Timeout" )\
135  ADD( ModuleIsBusy, "Module is busy" )\
136  ADD( NoFileSystemMounted, "No file system mounted" )\
137  ADD( NoSupportedByFileSystem, "No supported by file system" )\
138  ADD( ObjectNotCorrect, "Object is not correct" )\
139  ADD( ObjectNotFoundOnList, "Object not found on list" )\
140  ADD( SomeDataLost , "Some data was lost" )\
141  ADD( CannotUnblockThread, "Cannot unblock thread" )\
142  ADD( RootUserNotExist, "Root user not exists" )\
143  ADD( CannotRemoveRoot, "Cannot remove root" )\
144  ADD( UserInUse, "User already in use" )\
145  ADD( UserExists, "User already exists" )\
146  ADD( UserNotExists, "User doesn't exist" )\
147  ADD( CannotRenameUser, "Cannot rename user" )\
148  ADD( InvalidUserName, "Invalid user name")\
149  ADD( WrongThread, "Wrong thread" )\
150  ADD( NotImplemented , "Functionality not implemented" )\
151  ADD( ImplementError , "Implementation error!" )\
152  ADD( WrongParameters , "Given parameters are not correct" )\
153  ADD( WrongFrequency , "Given frequency is not correct" )\
154  ADD( WrongUser, "User is not correct" )\
155  ADD( WrongAddress , "Given address is not correct" )\
156  ADD( WrongConfigAddress , "Given configuration address is not correct" )\
157  ADD( WrongEventHandlerAddress , "The event handler address is not correct" )\
158  ADD( FrequencyNotPossible , "Configuration of this frequency is not possible" )\
159  ADD( OutputAddressNotInRAM , "The address for output function variable is not pointing to RAM section." )\
160  ADD( WrongChannel , "Given channel is not correct" )\
161  ADD( BitRateNotCorrect , "Bit rate is not correct" )\
162  ADD( SpeedNotCorrect , "Speed is not correct" )\
163  ADD( BitRateNotSupported , "Bit rate is not supported" )\
164  ADD( BitRateNotSet , "Bit rate is not set" )\
165  ADD( ChannelIsUsed , "Given channel is used" )\
166  ADD( ValueTooBig, "Given value is too big" )\
167  ADD( MaximumValueNotCorrect, "Maximum value is not correct" )\
168  ADD( CannotRestoreDefaultState, "Cannot restore default module state" )\
169  ADD( DriverNotTurnedOn , "The driver is not turned on!" )\
170  ADD( DriverNotTurnedOff , "The driver is not turned off!" )\
171  ADD( DriverNotRegistered, "The given driver is not registered!" )\
172  ADD( NotHandledByDriver, "The given driver not handle this functionality!" )\
173  ADD( FunctionNotExists, "Function not exists!" )\
174  ADD( ModuleNotStartedYet, "Module has not started yet!" )\
175  ADD( NoneElementReceived, "None element received!" )\
176  ADD( ModuleIsTurnedOn, "Module is already turned on!" )\
177  ADD( ModuleIsTestedAlready, "Module is already tested!" )\
178  ADD( InterruptHandlerNotSet, "Handler function for interrupt is not set!" )\
179  ADD( InterruptHandlerAlreadySet, "Handler function for interrupt is already set!" )\
180  ADD( CannotTurnOnInterruptInMachineModule, "Cannot turn on interrupt in the machine!" )\
181  ADD( CannotTurnOffInterruptInMachineModule, "Cannot turn off interrupt in the machine!" )\
182  ADD( MachineHeapError, "Machine heap is not correct!" )\
183  ADD( PositionNotCorrect, "Position is not correct!" )\
184  ADD( MachineCanBeDamaged, "Unexpected behavior! Machine can be damaged!" )\
185  ADD( WrongStackSize, "The given stack size is not correct!" )\
186  ADD( PolarityNotCorrect, "Polarity not correct!" )\
187  ADD( ChannelOperationsNotDisabled, "Channel operations not disabled!" )\
188  ADD( ChannelOperationsNotEnabled, "Channel operations not enabled!" )\
189  ADD( CannotEnableInterrupt, "Cannot enable interrupt!" )\
190  ADD( CannotDisableInterrupt, "Cannot disable interrupt!" )\
191  ADD( HeapPointersNotInitialized, "Heap pointers are not initialized!" )\
192  ADD( ModuleNeedRestart, "Restart of the module is required!" )\
193  ADD( ModuleUsedByDifferentModule, "Module used by different module!" )\
194  ADD( CannotInitializeStack, "Cannot initialize stack!" )\
195  ADD( ClockConfigurationError, "Error while configuration of clock" )\
196  ADD( UnsupportedOscillator, "The given oscillator is not supported" )\
197  ADD( ResolutionNotSet, "Resolution not set" )\
198  ADD( SystemClockNotConfigured, "The system clock is not configured" )\
199  ADD( NotSupportedOnTargetMachine, "The feature is not supported on the target machine" )\
200  ADD( ChannelNotPoweredOn, "The given channel is not turned on!" )\
201  ADD( CannotEnableChannel, "The given channel cannot be turned on!" )\
202  ADD( NotSinglePin, "The given pin is not single pin!" )\
203  ADD( PowerStateNotCorrect, "The given power state is not correct!" )\
204  ADD( PeripheralPinNotDefined, "Peripheral pin is not defined" )\
205  ADD( PinNotDefined, "Pin is not defined" )\
206  ADD( WordLengthNotCorrect, "Word length is not correct" )\
207  ADD( ColorNotCorrect, "Color is not correct" )\
208  ADD( PinIsUsed, "Pin is used" )\
209  ADD( OutputArrayToSmall, "Output array is too small" )\
210  ADD( MachineSpecificValueNotCorrect, "The machine specific value is not correct!" )\
211  ADD( SizeNotCorrect, "The size is not correct!" )\
212  ADD( NoChannelAvailable, "None of channel is available!" )\
213  ADD( CannotAddObjectToList, "Cannot add object to list!" )\
214  ADD( CannotRemoveObjectFromList, "Cannot remove object from list!" )\
215  ADD( CannotDeleteObject, "Cannot delete object!" )\
216  ADD( IndexNotCorrect, "Index is not correct" )\
217  ADD( CommandNotCorrect, "Command is not correct!" )\
218  ADD( CommandNotHandled, "Command is not handled by the module!" )\
219  ADD( DmaModeNotCorrect, "DMA mode is not correct" )\
220  ADD( DMAAddressNotHandledByDma, "The address is not handled by the DMA!" )\
221  ADD( DMAElementSizeNotCorrect, "Element size is not correct!" )\
222  ADD( DMANumberOfTransfersNotCorrect, "Number of transfers is not correct!" )\
223  ADD( DMABufferSizeMustBePowerOf2, "Buffer size must be power of 2!" )\
224  ADD( DMASoftwareTransferNotPossibleOnThisChannel, "Software transfer is not possible on this channel!" )\
225  ADD( DMAPeripheralTransferNotPossibleOnThisChannel, "This peripheral transfer is not possible on this channel!" )\
226  ADD( DMATransmitDirectionNotCorrect, "Transmit direction is not correct!" )\
227  ADD( PinNeedUnlock, "This pin need to be unlocked before usage" )\
228  ADD( GPIOPinNeedUnlock, "This pin need to be unlocked before usage" )\
229  ADD( GPIOPinIncorrect , "Pin is incorrect" )\
230  ADD( GPIOPinIsUsed , "Pin is used" )\
231  ADD( GPIOCurrentNotCorrect , "The given GPIO current is not correct" )\
232  ADD( GPIOModeNotCorrect , "The given GPIO mode is not correct" )\
233  ADD( PullNotCorrect , "The given pull is not correct" )\
234  ADD( OutputCircuitNotCorrect , "The given output circuit mode is not correct" )\
235  ADD( GPIOIntTriggerNotCorrect , "The given GPIO interrupt trigger is not correct" )\
236  ADD( GPIOModeConfigureError , "Error while setting mode of GPIO pin" )\
237  ADD( GPIOOutputCircuitConfigureError , "Error while setting output circuit of GPIO pin" )\
238  ADD( GPIOPullConfigureError , "Error while setting pull of GPIO pin" )\
239  ADD( GPIOCurrentConfigureError , "Error while setting current of GPIO pin" )\
240  ADD( GPIOSpeedConfigureError , "Error while setting speed of GPIO pin" )\
241  ADD( GPIOInterruptConfigureError , "Error while setting interrupt of GPIO pin" )\
242  ADD( GPIOADDInterruptToListError , "Error while adding interrupt of GPIO pin to list" )\
243  ADD( SYSUnknownOscillatorSource , "Unknown oscillator source" )\
244  ADD( SYSConfigurationError , "Error while configuration of system clock" )\
245  ADD( OSPIDNotExists , "Process with given ID not exists" )\
246  ADD( OSNotAllThreadsCancelled, "One or more threads cannot be cancelled" )\
247  ADD( OSDuplicatePID , "Process ID is duplicated" )\
248  ADD( OSProcessNotFinished , "Process is not finished" )\
249  ADD( OSGlobalVariableRegistrationError , "Error while registration of the global variable" )\
250  ADD( OSCannotKillChildProcess , "At least one of children processes cannot be killed" )\
251  ADD( OSWrongThread , "Not correct thread reference" )\
252  ADD( OSWrongTTY, "Not correct TTY reference" )\
253  ADD( TTYConfigurationIncorrect , "Configuration is not correct" )\
254  ADD( TTYCannotCreateDLIST , "Cannot create dynamic list" )\
255  ADD( TTYCannotCreateMutex, "Cant create mutex object" )\
256  ADD( UARTNotCorrectChannel, "The given channel number is not correct" )\
257  ADD( UARTCannotPrepareTRAHN, "Error while creating TRANH object" )\
258  ADD( UARTPinNotDefined, "Given pin is not defined" )\
259  ADD( UARTCantConfigurePin, "Cannot configure GPIO pin" )\
260  ADD( UARTNotCorrectWordLength, "Given word length is not correct" )\
261  ADD( UARTWordLengthNotSupported, "Given word length is not supported on selected architecture" )\
262  ADD( UARTParityNotSupported, "Given parity mode is not supported on selected architecture" )\
263  ADD( UARTStopBitNotSupported, "Given stop bit mode is not supported on selected architecture" )\
264  ADD( UARTBitOrderNotSupported, "Given bit order mode is not supported on selected architecture" )\
265  ADD( UARTInvertNotSupported, "Given invert mode is not supported on selected architecture" )\
266  ADD( UARTBitRateNotSupported, "Given bit-rate is not supported on this architecture" )\
267  ADD( UARTInterruptConfigureError, "Error while setting interrupt priority for UART channel" )\
268  ADD( TIMLockingLockedChannel, "Trying to lock locked channel" )\
269  ADD( TIMUnlockingUnlockedChannel, "Trying to unlock channel which is not locked" )\
270  ADD( TIMChannelNotConfigured, "The selected channel is not configured" )\
271  ADD( TIMMatchCallbackNotCorrect, "The match callback function pointer is not correct" )\
272  ADD( TIMMatchContextNotCorrect, "The match callback context pointer is not correct" )\
273  ADD( TIMTimeoutCallbackNotCorrect, "The timeout callback function pointer is not correct" )\
274  ADD( TIMTimeoutContextNotCorrect, "The timeout callback context pointer is not correct" )\
275  ADD( TIMNoneOfChannelsAvailable, "None of channel available" )\
276  ADD( TIMModeNotCorrect, "Timer mode is not correct" )\
277  ADD( TIMERCountsDirNotCorrect, "Count direction is not correct" )\
278  ADD( TIMERSubTimerNotCorrect, "SubTimer is not correct" )\
279  ADD( TIMERBothSubTimersNeeeded, "Both SubTimers are needed" )\
280  ADD( TIMERCountsDirNotPossible, "Count direction is not possible with this configuration" )\
281  ADD( TIMERModeNotCorrect, "Mode is not correct" )\
282  ADD( TIMERModeNotSelected, "Timer mode not selected" )\
283  ADD( TIMERTriggerNotCorrect, "Input trigger is not correct" )\
284  ADD( TIMERChannelNotStopped, "Channel is not stopped" )\
285  ADD( TIMERFrequencyNotPossibleInFullMode, "Frequency not possible in full timer mode" )\
286  ADD( TIMERMaximumValueTooBig, "Maximum value is too big" )\
287  ADD( TIMTickSourceNotSupported, "The selected TickSource is not supported" )\
288  ADD( TIMSizeNotSupported, "The given size is not supported" )\
289  ADD( TIMTickPeriodNotSupported, "The given tick period is not supported" )\
290  ADD( TIMSizeNotSupportedOnSelectedChannel, "The given size is not supported on selected channel" )\
291  ADD( TIMMatchValueTooBig, "The given match value is too big" )\
292  ADD( TIMMaxValueTooBig, "The given max value is too big" )\
293  ADD( TIMCantCalculatePrescaler, "Error while calculating prescaler" )\
294  ADD( TIMTickPeriodTooSmall, "The given tick period is too small for this channel" )\
295  ADD( TIMTickPeriodTooBig, "The given tick period is too big for this channel" )\
296  ADD( TIMCountsDirNotSupported, "The given counts direction is not supported" )\
297  ADD( TIMValueTooBig, "The given timer value is too big for this channel" )\
298  ADD( TimeAlreadyTurnedOn, "Time module is already turned on" )\
299  ADD( TimeAlreadyTurnedOff, "Time module is already turned off" )\
300  ADD( TimeCannotCreateWakeUpList, "Error while creating wake up list" )\
301  ADD( TimeCannotCreateConfigEvent, "Error while creating configuration event" )\
302  ADD( ClockPhaseNotSupported, "Given clock phase is not supported on selected architecture" )\
303  ADD( ClockPolarityNotSupported, "Given clock polarity is not supported on selected architecture" )\
304  ADD( ChipSelectPolarityNotSupported, "Given chip select polarity is not supported on selected architecture" )\
305  ADD( FunctionNotSupportedInCurrentMode, "The function is not supported in current mode" )\
306  ADD( ModeNotSupported, "Given mode is not supported on selected architecture" )\
307  ADD( FrameWidthNotSupported, "Given frame width is not supported on selected architecture" )\
308  ADD( FrameTypeNotSupported, "Given frame type is not supported on selected architecture" )\
309  ADD( StateNotSupported, "Given state of Chip Select is not supported" )\
310  ADD( PulseWidthTooBig, "Pulse width too big" )\
311  ADD( AddressNotInRam, "Address is not in ram" )\
312  ADD( WrongBufferEndAddress, "Wrong buffer end address" )\
313  ADD( ColorFormatNotSupported, "Color format not supported" )\
314  ADD( ColorFormatNotCorrect, "Color format not correct" )\
315  ADD( ColorMapNotCorrect, "Color map not correct" )\
316  ADD( TimingParametersNotSupported, "Timing parameters not supported" )\
317  ADD( TimingParametersNotFilled, "Timing parameters not filled" )\
318  ADD( AddressNotInExternalMemory, "Address is not stored in external memory" )\
319  ADD( HeapMapAlreadyConfigured, "Heap map already configured" )\
320  ADD( HeapMapNotConfigured, "Heap map not configured" )\
321  ADD( WritingNotPermitted, "Writing not permitted" )\
322  ADD( ReadingNotPermitted, "Reading not permitted" )\
323  ADD( ProtectionNotCorrect, "Protection not correct" )\
324  ADD( DataBusWidthNotCorrect, "Data bus width not correct" )\
325  ADD( DataBusWidthNotSupported, "Data bus width not supported" )\
326  ADD( AccessWidthNotCorrect, "Access width not correct" )\
327  ADD( SizeTooBig, "Size too big" )\
328  ADD( NoFreeBankAvailable, "No free bank available" )\
329  ADD( MemoryTypeNotCorrect, "Memory type is not correct" )\
330  ADD( DelayNotPossible, "Delay is not possible" )\
331  ADD( RowBitsNumberNotSupported, "Row bits number not supported" )\
332  ADD( ColumnBitsNumberNotSupported, "Column bits number not supported" )\
333  ADD( AutoStackMethodNotCorrect, "Auto stack method is not correct" )\
334  ADD( NumberOfBanksNotCorrect, "Number of banks not correct" )\
335  ADD( NumberOfBanksNotSupported, "Number of banks not supported" )\
336  ADD( CasLatencyNotCorrect, "CAS Latency not correct" )\
337  ADD( CasLatencyNotSupported, "CAS Latency not supported" )\
338  ADD( DirectAccessNotPossible, "Direct access not possible" )\
339  ADD( CannotAccessMemory, "Cannot access memory" )\
340  ADD( AccessPermissionsNotPossible, "Access permissions are not possible" )\
341  ADD( AccessPermissionsNotCorrect, "Access permissions are not correct" )\
342  ADD( RegionNumberNotCorrect, "Region number is not correct" )\
343  ADD( AutoConfigurationsNotAvailable, "Auto configurations not available" )\
344  ADD( NumberOfRowsNotCorrect, "Number of rows is not correct" )\
345  ADD( MemoryNotConfigured, "Memory not configured" )\
346  ADD( AutoRefreshPeriodNotCorrect, "Auto refresh period not correct" )\
347  ADD( ReadPipeDelayNotPossible, "Read pipe delay not possible" )\
348  ADD( NotGraphicDriver, "Driver is not graphic driver!" )\
349  ADD( AlreadyConfigured, "Already configured" )\
350  ADD( NotConfiguredYet, "Not configured yet" )\
351  ADD( ObjectProtected, "Object is protected" )\
352  ADD( CommunicationInterfaceNotCorrect, "Communication interface not correct" )\
353  ADD( PinNotSet, "Required pin is not set" )\
354  ADD( CannotDisableChannel, "Cannot disable channel" )\
355  ADD( MacNotInitialized, "MAC not initialized" )\
356  ADD( PhyAddressNotCorrect, "PHY address not correct" )\
357  ADD( RegisterAddressNotCorrect, "Register address not correct" )\
358  ADD( CannotAccessRegister, "Cannot access register" )\
359  ADD( OtherCommunicationInterfaceInUse, "Other communication interface in use" )\
360  ADD( NoMoreConfigurationsPossible, "No more configurations possible" )\
361  ADD( ChipNameNotDefined, "Chip name is not defined" )\
362  ADD( DriverTypeNotCorrect, "Driver type not correct" )\
363  ADD( StringIsEmpty, "String is empty" )\
364  ADD( StringIsTooLong, "String is too long" )\
365  ADD( CannotGiveSemaphore, "Cannot give semaphore" )\
366  ADD( FoundOnList, "Already found on the list" )\
367  ADD( NoneActiveNetif, "None of network interfaces isn't active" )\
368  ADD( IpAddressNotCorrect, "IP address is not correct" )\
369  ADD( IpAddressEmpty, "IP address is empty" )\
370  ADD( AddressTypeNotCorrect, "Address type is not correct" )\
371  ADD( RoutingTableEntryNotFound, "Routing table entry not found" )\
372  ADD( NetifNotCorrect, "Netif not correct" )\
373  ADD( ProcessAlreadyStarted, "Process has started already" )\
374  ADD( CannotDeleteThread, "Cannot delete thread" )\
375  ADD( LinkNotDetected, "Link not detected" )\
376  ADD( UnknownHardwareType, "Unknown hardware type" )\
377  ADD( UnknownAddressType, "Unknown address type" )\
378  ADD( UnknownHardwareAddress, "Unknown hardware address" )\
379  ADD( HardwareAddressIsEmpty, "Hardware address is empty" )\
380  ADD( AlignmentNotCorrect, "Alignment not correct" )\
381  ADD( DescriptorListNotInitialized, "Descriptor list not initialized" )\
382  ADD( NoFreeSlots, "No free slots" )\
383  ADD( InternalDataAreDamaged, "Internal data are damaged (stack has been overwritten?)" )\
384  ADD( DataNotAvailable, "Data not available" )\
385  ADD( BaudRateNotSupported, "Baud rate not supported" )\
386  ADD( OperationModeNotCorrect, "Operation mode not correct" )\
387  ADD( WrongMacAddressIndex, "Wrong MAC address index" )\
388  ADD( TimeNotCorrect, "Time not correct" )\
389  ADD( AllocatorNotCorrect, "Allocator not correct" )\
390  ADD( ReceiveError, "Receive error" )\
391  ADD( UnfinishedPacket, "Unfinished packet" )\
392  ADD( MemoryAlreadyAllocated, "Memory already allocated" )\
393  ADD( MemoryNotAllocated, "Memory not allocated" )\
394  ADD( UnknownLayer, "Unknown layer" )\
395  ADD( NotDmaAddress, "The given address is not correct DMA address" )\
396  ADD( CannotConvertHeaderEndianess, "Cannot convert header endianess" )\
397  ADD( PortNotCorrect, "Port not correct" )\
398  ADD( PortNotReserved, "Port not reserved" )\
399  ADD( PortNotAvailable, "Port not available" )\
400  ADD( PortReservedByDifferentProcess, "Port reserved by different process" )\
401  ADD( PermissionDenied, "Permission denied" )\
402  ADD( PossibleOnlyForRoot, "Possible only for root" )\
403  ADD( TypeNotCorrect, "Type is not correct" )\
404  ADD( PacketNotCorrect, "Packet is not correct" )\
405  ADD( CannotFindNetifForTheAddress, "Cannot find Netif for the given address" )\
406  ADD( ModuleBusy, "Module is busy" )\
407  ADD( PortBusy, "Port is busy" )\
408  ADD( AddressNotInInternalRam, "Address is not in internal RAM" )\
409  ADD( SegmentTypeNotSupported, "Segment type is not supported" )\
410  ADD( HardwareAddressNotFilled, "Hardware address not filled" )\
411  ADD( SizeNotAligned, "Size is not aligned" )\
412  ADD( TypeReservedByDifferentProcess, "Type reserved by different process" )\
413  ADD( TypeNotReserved, "Type is not reserved" )\
414  ADD( TypeBusy, "Type is busy" )\
415  ADD( HostNotAvailable, "Host not available" )\
416  ADD( NotConnected, "Not connected" )\
417  ADD( AlreadyConnected, "Already connected" )\
418  ADD( ServerNotStarted, "Server not started" )\
419  ADD( DriverImplementedIncorrectly, "Driver implemented incorrectly" )\
420  ADD( NoSpaceAvailable, "No space available" )\
421  ADD( OptionNotFound, "Option not found" )\
422  ADD( OptionNotCorrect, "Option not correct" )\
423  ADD( OptionNotAdded, "Option not added" )\
424  ADD( WindowSizeNotCorrect, "Window size not correct" )\
425  ADD( ObjectInUse, "Object in use" )\
426  ADD( CannotClearOptions, "Cannot clear options" )\
427  ADD( ConnectionNotRequested, "Connection not requested" )\
428  ADD( AlreadyRunning, "Already running" )\
429  ADD( NotRunning, "Not running" )\
430  ADD( ConnectionExpired, "Connection has expired" )\
431  ADD( ConnectionFromDifferentServer, "Connection from different server" )\
432  ADD( ModuleNotCorrect, "Module not correct" )\
433  ADD( ModuleAlreadyRegistered , "Module already registered" )\
434  ADD( ModuleNotRegistered , "Module not registered" )\
435  ADD( PortAlreadyReserved, "Port already reserved" )\
436  ADD( RequiredModuleNotEnabled, "Required module not enabled" )\
437  ADD( WrongCommandArgument, "Wrong command argument" )\
438  ADD( CannotKillProcess, "Cannot kill process" )\
439  ADD( ConnectionInProgress, "Connection in progress" )\
440  ADD( ConnectionHasBeenFinishedTooEarly, "Connection has been finished too early" )\
441  ADD( ModuleHasNotStartedCorrectly, "Module has not started correctly" )\
442  ADD( ModuleHasNotBeenStoppedCorrectly, "Module has not been stopped correctly" )\
443  ADD( ServiceNotStarted, "Service has not started yet" )\
444  ADD( ServiceAlreadyStarted, "Service already started" )\
445  ADD( ProgramNotCorrect, "Program not correct " )\
446  ADD( NoDataToSend, "No data to send" )\
447  ADD( NoSpaceOnRemoteServer, "No space on remote server" )\
448  ADD( InterruptsNotEnabled, "Interrupts not enabled" )\
449 
450 /*==========================================================================================================================================
451 //
452 // MACROS
453 //
454 //========================================================================================================================================*/
455 #define _ADD_ERROR_TO_ENUM( CODE_NAME , DESCR ) oC_1WORD_FROM_2( oC_ErrorCode_ , CODE_NAME ) ,
456 
457 /*==========================================================================================================================================
458 //
459 // TYPES
460 //
461 //========================================================================================================================================*/
462 
463 //==========================================================================================================================================
469 //==========================================================================================================================================
470 typedef enum
471 {
472  oC_ErrorCode_None ,
473 #ifndef DOXYGEN
474  oC_ERRORS_LIST(_ADD_ERROR_TO_ENUM)
475 #endif
476  oC_ErrorCode_NumberOfErrorsDefinitions
477 } oC_ErrorCode_t;
478 
479 /*==========================================================================================================================================
480 //
481 // FUNCTION PROTOTYPES
482 //
483 //========================================================================================================================================*/
484 
485 extern const char * oC_GetErrorString ( oC_ErrorCode_t ErrorCode );
486 extern bool oC_SaveErrorFunction ( const char * Description , oC_ErrorCode_t ErrorCode , const char * Function , uint32_t LineNumber );
487 extern bool oC_ReadLastError ( const char ** outDescription, oC_ErrorCode_t * outErrorCode , const char ** outFunction , uint32_t * outLineNumber );
488 extern void oC_SetLockSavingErrors ( bool Lock );
489 
490 /*==========================================================================================================================================
491 //
492 // INLINE FUNCTIONS
493 //
494 //========================================================================================================================================*/
495 
496 //==========================================================================================================================================
519 //==========================================================================================================================================
520 static inline bool oC_AssignErrorCode( oC_ErrorCode_t * outErrorCode , oC_ErrorCode_t ErrorCode )
521 {
522  bool errorOccur = ErrorCode != oC_ErrorCode_None;
523  if ( errorOccur )
524  {
525  outErrorCode[0] = ErrorCode;
526  }
527  return !errorOccur;
528 }
529 
530 //==========================================================================================================================================
540 //==========================================================================================================================================
541 static inline bool oC_AssignErrorCodeIfFalse( oC_ErrorCode_t * outErrorCode , bool Condition , oC_ErrorCode_t ErrorCode )
542 {
543  return oC_AssignErrorCode( outErrorCode , (Condition) ? oC_ErrorCode_None : ErrorCode );
544 }
545 
546 //==========================================================================================================================================
554 //==========================================================================================================================================
555 static inline bool oC_ErrorOccur( oC_ErrorCode_t ErrorCode )
556 {
557  return ErrorCode != oC_ErrorCode_None;
558 }
559 
560 //==========================================================================================================================================
561 //==========================================================================================================================================
562 static inline bool oC_SaveIfErrorOccurFunction( const char * Description , oC_ErrorCode_t ErrorCode , const char * Function, uint32_t LineNumber )
563 {
564  bool success = true;
565 
566  if(oC_ErrorOccur(ErrorCode))
567  {
568  oC_SaveErrorFunction(Description,ErrorCode,Function,LineNumber);
569  success = false;
570  }
571 
572  return success;
573 }
574 
575 //==========================================================================================================================================
576 //==========================================================================================================================================
577 static inline bool oC_SaveIfFalseFunction( const char * Description , bool Condition , oC_ErrorCode_t ErrorCode , const char * Function, uint32_t LineNumber )
578 {
579  bool success = true;
580 
581  if(Condition == false)
582  {
583  oC_SaveErrorFunction(Description,ErrorCode,Function,LineNumber);
584  success = false;
585  }
586 
587  return success;
588 }
589 
595 #define _________________________________________MACROS_SECTION_____________________________________________________________________________
596 
597 #define ErrorCondition( Condition , ErrorCode ) oC_AssignErrorCodeIfFalse(&errorCode , Condition , ErrorCode )
598 #define ErrorCode( ErrorCode ) oC_AssignErrorCode(&errorCode , ErrorCode )
599 #define oC_BeginProcedure do
600 #define oC_EndProcedure while(0);
601 #define oC_ExitProcedureIfError(Step) if(oC_AssignErrorCode(&errorCode,Step) == false) { break; }
602 #define oC_ExitProcedureIfFalse(Step) if(oC_AssignErrorCode(&errorCode,Step) == false) { break; }
603 
604 #define oC_Procedure_Begin do
605 #define oC_Procedure_End while(0);
606 #define oC_Procedure_ExitIfError(ErrorCode) if( oC_AssignErrorCode(&errorCode,ErrorCode) == false ) { break; }
607 #define oC_Procedure_ExitIfFalse(Condition,ErrorCode) if( oC_AssignErrorCodeIfFalse(&errorCode,Condition,ErrorCode) == false ) { break; }
608 
609 #define oC_SaveError(String,ErrorCode) oC_SaveErrorFunction(String,ErrorCode,oC_FUNCTION,oC_LINE)
610 #define oC_SaveIfErrorOccur(String,ErrorCode) oC_SaveIfErrorOccurFunction(String,ErrorCode,oC_FUNCTION,oC_LINE)
611 #define oC_SaveIfFalse(String,Condition,ErrorCode) oC_SaveIfFalseFunction(String,Condition,ErrorCode,oC_FUNCTION,oC_LINE)
612 
613 #undef _________________________________________MACROS_SECTION_____________________________________________________________________________
614 
615 
616 #endif /* SYSTEM_GEN_OC_ERRORS_H_ */
Contains macros for creating one word from more words in macros.
The file contains definitions for the compiler, that helps to manage errors, etc. ...
void oC_SetLockSavingErrors(bool Lock)
locks or unlocks saving errors
Definition: oc_errors.c:185
bool oC_SaveErrorFunction(const char *Description, oC_ErrorCode_t ErrorCode, const char *Function, uint32_t LineNumber)
save error code with description for later
Definition: oc_errors.c:139
const char * oC_GetErrorString(oC_ErrorCode_t ErrorCode)
Definition: oc_errors.c:115
bool oC_ReadLastError(const char **outDescription, oC_ErrorCode_t *outErrorCode, const char **outFunction, uint32_t *outLineNumber)
reads error code with description from the errors stack
Definition: oc_errors.c:162