Robustness is Key to Certification
Safety-certified products must be stable and bug-free. Micrium has made no significant changes to µC/OS-II since 2008, and our last reported bug was fixed in 2007.
Thousands of products use µC/OS-II in avionics, medical devices, and industrial controls.
Micrium’s Comprehensive Coding Standards
Micriµm has very strict coding rules and coding style, and so we have published a comprehensive 200-page coding standards guide. The guide is freely available for download. Some highlights:
- Standard directory structures for files and projects
- Recommended coding style to use (C and assembly)
- Naming conventions for functions, variables, constants, #defines, macros, etc.
- Acronyms, abbreviations, mnemonics
- Best coding practices
- Mandatory for all employees and contractors
Module Prefix and Hierarchy
Every Micrium software module has a standardized naming system for related functions, #define, constants, variables, and so on. Each is prefixed with the module’s name:
- Kernel starts with OS…
- TCP/IP starts with Net…
- USB Device starts with USBD…
- USB Host starts with USBH…
- File System starts with FS…
- Modbus starts with MBS… (slave) and MBM… (master)
This method makes it easier to know which module defines what functionality. It avoids name clashes, and presents a clear hierarchy. Function calls, variables, and constants use a Module-Object-Action naming convention like this:
Every function has a comprehensive comment block that documents the function, as shown below. Some comment blocks are highly comprehensive and even contain illustrations. RFCs are referenced in µC/TCP-IP as needed.
Separating Code and Comments
Micrium's standard for code commenting is as follows:
- Code on the left. This makes it easier to differentiate from comments.
- Comments on the right. We don’t ‘pollute’ code with comments.
- Code lined up when appropriate. Function call arguments are lined up one per line. Comments and equal signs are lined up. Numeric values (when appropriate) are lined up by their ‘weight’ (units lined up with units).
Optional Run-Time Argument Checking
Run-time argument checking protects code from user errors. It provides a boundary check on arguments, and returns comprehensive error values. Further, Micrium does not use obscure constructs or magic numbers.
High Performance Designed for Embedded Systems
Micrium's source code is written with resource-limited MCUs in mind. This means that code size and RAM usage are always considered, as smaller code typically means faster code. Argument checking can be disabled at compile time, which streamlines the code.
Micrium source code provides run-time statistics to help you improve your code. This includes interrupt disable time, scheduler lock time, per-task CPU usage, and so on. Run-time statistics can be disabled at compile time to reduce code and data sizes.