3 Star 4 Fork 3

ianhom / MOE

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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.
/* 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;
}
  • 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)
/* EXAMPLE CODE */
/* Task 1: Blinking LED */
uint8 Task_PT_Demo_Process(uint8 u8Evt, void *pPara)
{   
    PT_INIT();
    PT_BEGIN();
    MOE_MANDATORY_INIT();  /* Mandatory init, shout call it here only */

    while(1)
    {
        TASK_PT_DEMO_LED_Toggle(LED_RED);
        PT_DELAY(1000);

        TASK_PT_DEMO_LED_Toggle(LED_GREEN);
        PT_DELAY(1000);

        TASK_PT_DEMO_LED_Toggle(LED_BLUE);
        PT_DELAY(1000);
    }
    PT_END();
    return SW_OK;
}
/* EXAMPLE CODE */
/* Task 2: Periodic printing */
uint8 Task_PT_Demo2_Process(uint8 u8Evt, void *pPara)
{    
    PT_INIT(); 
    PT_BEGIN();
    MOE_MANDATORY_INIT();  /* Mandatory init, shout call it here only */

    while(1)
    {
        DBG_PRINT("I am another Task!!\n");
        PT_DELAY(1000);
    }
    PT_END();
    return SW_OK;
}
  • Step 3: Register tasks in Project_Config.h and continue other configuration in the same file.
#define LIST_OF_REG_TASK \
        REG_TASK(Task_PT_Demo_Proces)\
        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:
MIT License Copyright (c) 2016 Ian Hom(Ye Hong) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

MOE is an event-driven operating system for 8/16/32-bit MCUs. 展开 收起
C 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C
1
https://gitee.com/ianhom/MOE.git
git@gitee.com:ianhom/MOE.git
ianhom
MOE
MOE
master

搜索帮助