ECN>> MOE>> 返回
项目作者: ianhom

项目描述 :
MOE is an event-driven OS for 8/16/32-bit MCUs. MOE means "Minds Of Embedded system", It’s also the name of my lovely baby daughter :sunglasses:
高级语言: C
项目地址: git://github.com/ianhom/MOE.git
创建时间: 2016-04-27T09:35:37Z
项目社区:https://github.com/ianhom/MOE

开源协议:MIT License

下载


MOE

license GitHub release status
中文说明

Smartphone with MOE

The first smartphone with MOE in the world!…….Bazinga!!!


LOGO

Introduce

MOE is an event-driven scheduler system for 8/16/32-bit MCUs. MOE means “Minds Of Embedded system”, it’s also the name of my lovely baby daughter :smile:
Features with:

Features Description
Event-driven Flexible event queue length, priority event supported.
Timer Useful ms-timer with callback.
Message Easy-use message API for communication between tasks, To-All-Task message with low RAM comsuption supported.
Debug Flexible debug print options for each task or module; Useful easy-assert; CmBacktrace(Hardfault backtrace for Cortex-M)
Protothread Protothread is supported for application module.

For more discussion, please join our QQ Group: 475258651

Supported Platform

  • MIMXRT1050-EVK………(coming soon)

How to use

  • Step 1: Port the MOE to your hardware, provide “system clock in ms“ and “poll function(if available)“, init and run MOE.
    ```c
    / EXAMPLE CODE /
    uint16 GetMsClock(void) / Function to get ms clock /
    {
    return sg_u16SysClk; / System ms clock, increased every 1 ms in hardware timer interrupt /
    }

void Poll(void) / Function to be Polled /
{
/ Something you want to do by polling /
return;
}

void main(void)
{
…. / Board init operation /
MOE_Init(GetMsClock, Poll); / Init MOE with system clock funtion, and poll function(fill “NULL” if NOT available) /
MOE_Run(); / Start MOE /
return;
}

  1. - **Step 2**: **Create** your own tasks or **re-use** exist app tasks to build your application. (Protothread style application is shown below, For event handler style, please see the source)
  2. ```c
  3. /* EXAMPLE CODE */
  4. /* Task 1: Blinking LED */
  5. uint8 Task_PT_Demo_Process(uint8 u8Evt, void *pPara)
  6. {
  7. PT_INIT();
  8. PT_BEGIN();
  9. MOE_MANDATORY_INIT(); /* Mandatory init, shout call it here only */
  10. while(1)
  11. {
  12. TASK_PT_DEMO_LED_Toggle(LED_RED);
  13. PT_DELAY(1000);
  14. TASK_PT_DEMO_LED_Toggle(LED_GREEN);
  15. PT_DELAY(1000);
  16. TASK_PT_DEMO_LED_Toggle(LED_BLUE);
  17. PT_DELAY(1000);
  18. }
  19. PT_END();
  20. return SW_OK;
  21. }
  1. /* EXAMPLE CODE */
  2. /* Task 2: Periodic printing */
  3. uint8 Task_PT_Demo2_Process(uint8 u8Evt, void *pPara)
  4. {
  5. PT_INIT();
  6. PT_BEGIN();
  7. MOE_MANDATORY_INIT(); /* Mandatory init, shout call it here only */
  8. while(1)
  9. {
  10. DBG_PRINT("I am another Task!!\n");
  11. PT_DELAY(1000);
  12. }
  13. PT_END();
  14. return SW_OK;
  15. }
  • Step 3: Register tasks in Project_Config.h and continue other configuration in the same file.
    1. #define LIST_OF_REG_TASK \
    2. REG_TASK(Task_PT_Demo_Proces)\
    3. REG_TASK(Task_PT_Demo2_Proces)
  • Step 4: Run & Enjoy. :smile:

Source Tree Structure

Folder Description
App/ App modules which can be re-used in different projects. Please add new app module here for new application requirement
Core/ Core files including scheduler, Event-drivern, timer and message.
Cpu/ Startup and other necessary code for starting MCUs
Debug/ Useful tool & modules for debugging
Driver/ Driver of MCU peripheral and other extended module(sensors or RF parts)
Network/ Stack for kinds fo network(to be done.)
Pub/ Public files including public head file, MACRO and debug file
Utility/ Useful function modules including queue, link list, printf
project/ Files for specific projects including configuration of SW/HW and the main file
Documents/ Description documents including design record, API reference and pictures
Tools/ Useful Tools for configuration, building, debugging, analysis and so on

Useful Documents

Special Thanks

  • :tada:MOE Logo drawing by Miss Cai Jianan.:tada: