我在使用 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
这是一个标准库,从研究中每个人似乎都在工作。关于为什么会发生这种情况的任何想法?