Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于兼容性和可移植性的讨论 #1

Open
wangyujin0831 opened this issue Feb 16, 2023 · 1 comment
Open

关于兼容性和可移植性的讨论 #1

wangyujin0831 opened this issue Feb 16, 2023 · 1 comment

Comments

@wangyujin0831
Copy link

wangyujin0831 commented Feb 16, 2023

在数据发送和引脚功能配置上可否加入类似如下的代码以加强在各类嵌入式平台的可移植性和可兼容性

#include "deng_foc_interface.h"

status I2C_send_interface(some pra)
{
    /*添加输入您库的代码*/
}

status I2C_read_interface(some pra)
{
    /*添加输入您库的代码*/
}

status delay_interface(some pra)
{
    /*添加输入您库的输入代码*/
}

status create_mutex_interface(some pra)
{
    /*添加输入您库的代码*/
}

status take_mutex_interface(some pra)
{
    /*添加输入您库的代码*/
}

status release_mutex_interface(some pra)
{
    /*添加输入您库的代码*/
}

status create_msg_interface(some pra)
{
    /*添加输入您库的代码*/
}

status take_msg_interface(some pra)
{
    /*添加输入您库的代码*/
}

stauts release_msg_interface(some pra)
{
    /*添加输入您库的代码*/
}

/*等等如果需要的话*/

如果有的话,可能仅仅需要完成该文件的移植,所有的代码在移植上就基本完成了,也需逻辑部分也是可以完全通用的
以此类推,也需这样的模块也是不错的

#include "hardware.h"

status some_hardware_init(some pra)
{
    /*添加输入您库的代码*/
}

status some_hardware_update(some pra)
{
    /*添加输入您库的代码*/
}

/*等等如果需要的话*/

这样的话算法部分和硬件部分就可以最大程度的分割开来。

@Deng-ge-open-source
Copy link
Contributor

很好的建议,后续会采用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants