arduino编译过程

arduino多个文件

  1. 把所有的.ino文件都给串联起来
  2. 把所有的.c , .cpp 文件都给单独的编译
  3. 对于那些.h文件在arduino IDE中是要被包含进来的

arduino编译过程

其实是把所哟的.ino文件串联起来放到一个叫main.cpp文件中,然后再让avr-gcc去编译

  1. #include “Arduino.h”
    在Arduino.h中已经包含了 /hardware/cores// 的核心代码
  2. 在所有的.ino 文件中寻找所有的函数,并且创建声明(即函数原型)。在include”file.h” 之后插入函数声明。所以有弊端:如果你在函数中用到了自定义的类型,就会出错。应该先在一个头文件中声明并包含进来。

    Next, the environment searches for function definitions within your main sketch file and creates declarations (prototypes) for them. These are inserted after any comments or pre-processor statements (#includes or #defines), but before any other statements (including type declarations). This means that if you want to use a custom type as a function argument, you should declare it within a separate header file. Also, this generation isn’t perfect: it won’t create prototypes for functions that have default argument values, or which are declared within a namespace or class.

  3. 最后,main.cxx文件的内容就会全部放在main.cpp的最后面

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值