shiftPWM和ATTiny85出错

时间:2015-12-16 21:25:45

标签: compilation attiny

我在这一点上迷了路,并感谢任何帮助!我从旧的GitHub下载了这个库,我甚至无法编译它。

Arduino: 1.6.6 Hourly Build 2015/10/14 10:42 (Windows 8.1), Board: "ATtiny 

x5 series, ATtiny85, 8 mhz (internal), B.O.D. Disabled"

Warning: platform.txt from core 'Arduino SAMD (32-bits ARM Cortex-M0+) Boards' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
Warning: platform.txt from core 'ATtiny Classic' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
In file included from C:\Users\Luke Bouchard\Documents\Arduino\libraries\ShiftPWM-master/ShiftPWM.h:25:0,

                 from C:\Users\Luke Bouchard\Documents\Arduino\test\test.ino:13:

C:\Users\Luke Bouchard\Documents\Arduino\libraries\ShiftPWM-master/pins_arduino_compile_time.h:318:3: error: 'PORTC' was not declared in this scope

  &PORTC,

   ^

C:\Users\Luke Bouchard\Documents\Arduino\libraries\ShiftPWM-master/pins_arduino_compile_time.h:319:3: error: 'PORTD' was not declared in this scope

  &PORTD,

   ^

exit status 1
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

1 个答案:

答案 0 :(得分:0)

看起来您的库不支持ATTINY85芯片。

为了使代码与ATTINY兼容,我不得不对库进行以下更改......

  • 缩小代码大小以适应ATTINY限制的FLASH空间。
  • 消除了对SPI和串行硬件的所有依赖性,因为ATTINY没有它们。
  • 使用现有的Timer0中断进行刷新触发,因为ATTINY的定时器较少。
  • 定义ATTINY的引脚和设备映射。

我还做了一些美学上的改变,比如在编译时静态分配缓冲区,因为没有串行连接就没有办法看到“内存不足”错误。

叉子在这里...... https://github.com/bigjosh/ShiftPWM-Redux

自述文件包含有关您的代码从旧库移动到新库(不是很难)的必要更改的信息。 fork中的示例也会更新以使用新库,因此这是一个很好的起点。