-
š Hi, Iām @woffish123
-
š Iām interested in Embedded system development,and sub 1G Networking protocol ..
-
š± Iām currently try to make a Easy to use and low cost general single chip microcomputer program architecture .
-
šļø Iām looking to Optimize and test the architecture
-
š« If you find problems or other parts that can be optimized, please let me know [email protected]
There are many mature embedded operating systems, but for simple application scenarios with low cost and low power consumption, these embedded operating systems are often too large and complex. Therefore, I wrote this simple message based operating system, which has little demand for ram, reduces the demand for the depth of the stack, supports low-power use scenarios, greatly simplifies the coupling of programs, and makes the program simple and easy to write . In the simplest case of one message loop, the minimum memory requirement is a minimum of 200 bytes.
the system based on message , Each message contains a message ID and a memory block ID, which are generated by the hardware layer interrupt or software and sent to different message loops The message of the system can be a simple message ID or combined with a memory block. It supports two kinds of messages: long message and short message. The long message consists of 4 bytes, the high 2 bytes are the memory block ID, and the high 2 bytes are the message ID. The short message consists of 2 bytes, 10 bit message ID and 7-bit memory block ID.
The system can establish multiple message loops. Each message loop contains a message queue. The system calls each message loop and executes the events in the message queue according to the order of establishing message loops.
Each message loop can register multiple static threads at the same time, and each static thread will register and wait for multiple events, The message loop gives priority to distributing events to these static threads. If the events are not processed by the static threads in the message loop, they are processed by the message loop itself.
For time-based messages, two structures are defined A: Fixed alarm messages are applicable to the distribution of long-period, cyclic or non cyclic time events. These messages are statically stored in the program. The system sorts these events and triggers them one by one using RTC, and distributes their predefined messages and their parameters to the message cycle B: Short time timing messages are applicable to the distribution of running timing events. These messages are generated by software. A low-power timer is used to sort these events and generate them one by one, and the messages contained in them are distributed to the specified message cycle
woffish123 Goto Github PK
Type: User