Code auto-generation is gradually replacing manual programming in the embedded software development.However,the present code auto-generation tools support only a few microcontrollers,which results in great restriction for their wide application.By analyzing the Simulink/Stateflow and RTWEC tool software,this paper presents a method for code auto-generation and integration,which can be applied in the embedded software development for any type of microcontroller.Using this method,simulation models are constructed rapidly and model parameters are adjusted on-line.This method was applied in developing the embedded software for automotive sunroof control.The result shows that it is feasible and easy to implement.%嵌入式软件代码自动生成的开发方法正在逐步取代手工编程,但是自动代码生成工具只对少数微控制器提供了完整支持,使这种方法的普及应用受到了很大的局限.笔者通过对Sim-ulink/Stateflow及RTWEC(实时工作间嵌入式代码生成器)工具软件的分析研究,提出了一种代码自动生成和代码整合的方法.通过构建基于Simulink的仿真模型,可自动生成优化的嵌入式实时仿真代码、在线调整模型参数并监视仿真数据.本方法对于使用任意型号微控制器的嵌入式软件开发都将适用,并且通过在汽车电动天窗控制软件开发实例中的应用,表明这种方法可行且易于实施.
展开▼