【发布时间】:2013-01-22 03:28:15
【问题描述】:
我在使用 AVR Studio 6 编译 Procyon 库时遇到了一些问题。我使用的代码完全适用于 AVR Studio 4。
以下行在这个公共库中编译失败:
//! prints a string stored in program rom
/// \note This function does not actually store your string in
/// program rom, but merely reads it assuming you stored it properly.
void rprintfProgStr(const prog_char str[]);
这会导致错误:
Error 1 unknown type name 'prog_char' D:\AVRTests\ProcyonLibTest\ProcyonLibTest\rprintf.h 85 1 ProcyonLibTest
这个函数的减速还有另一个错误。 下一个是:
// use this to store hex conversion in RAM
//static char HexChars[] = "0123456789ABCDEF";
// use this to store hex conversion in program memory
//static prog_char HexChars[] = "0123456789ABCDEF";
static char __attribute__ ((progmem)) HexChars[] = "0123456789ABCDEF";
这会导致错误:
Error 2 variable 'HexChars' must be const in order to be put into read-only section by means of '__attribute__((progmem))' D:\AVRTests\ProcyonLibTest\ProcyonLibTest\rprintf.c 45 39 ProcyonLibTest
这是一个标准库,根据研究,每个人似乎都在工作。关于为什么会发生这种情况的任何想法?
【问题讨论】:
-
如果您查看此问题,请考虑对其进行投票,以便获得了解 AVR 的人的关注。谢谢。