使用 AVR-Ada 执行任务
我正在尝试使用 AVR-Ada 实现任务功能,但是当我运行 make 时,我收到以下错误消息:
C:\avr_test>make
avr-gcc.exe (GCC) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ADA_PROJECT_PATH= avr-gnatmake -XMCU=atmega8 -p -Pbuild.gpr -XAVRADA_MAIN=led_on avr-gcc -c --RTS=rts/avr4 -gnatec=C:\avr-ada\lib\gnat\gnat.adc -gdwarf-2 -gnatwp -gnatwu gnatn -gnatp -gnatVn -Os -gnatef -fverbose-asm -frename-registers -mmcu=atmega8 gnateDMCU=atmega8 -fdata-sections -ffunction-sections -I- -gnatA C:\avr_test\led_on.adb
c:\avr_test\led_on.adb:3:06: warning: unit "task_bla" is not referenced
c:\avr_test\task_bla.ads:3:04: construct not allowed in configurable run-time mode
c:\avr_test\task_bla.ads:3:04: violation of restriction "no_tasking" at C:\avr-ada\lib \gnat\gnat.adc:124
avr-gnatmake: "c:\avr_test\led_on.adb" compilation error
make: ** [led_on.elf] Erro 4
那么,我该怎么做才能启用任务功能?
我的包只有非常简单的测试任务:(我只是想检查任务功能)
-- led_on.adb
with AVR; use AVR;
with AVR.MCU;
with task_bla;
procedure LED_On is
LED : Boolean renames MCU.PortB_Bits (3);
begin
MCU.DDRB_Bits := (others => DD_Output);
LED := Low;
end LED_On;
-- task_bla.ads
package task_bla is
task test;
end task_bla;
-- task_bla.adb
package task_bla is
task body test is
loop
null;
end loop;
end test;
end task_bla;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您必须为 AVR-Ada 的运行时系统实施任务。
我认为硬件不能很好地支持任务,所以这可能相当困难。
You would have to implement Tasking for the Runtime System of AVR-Ada.
I don't think the hardware supports tasking well, so this might be quite difficult.
在不了解 AVR 的情况下,您的 gnat.adc 文件中的第 124 行似乎有 no_tasking 限制,请查看此内容,看看是否可以安全地删除它。
注意:这可能是有充分理由的,所以这样做的风险由您自己承担。
Without knowing about AVR it looks like there is a no_tasking restriction in your gnat.adc file, at line 124, have a look at this and see if you can remove it safely.
NOTE: This was probably put in for a GOOD reason, so do so at your own risk.
我找到了可能是这件事的线索。我正在更详细地阅读 AVR-Ada 文档,我在 AVR-Ada Sourceforge 文档 Status 区域中找到了这一点-ada/index.php?title=状态" rel="nofollow">http://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=状态:
因此,任务分配功能一开始并未启用/可用。深入文档,我在 http://sourceforge .net/apps/mediawiki/avr-ada/index.php?title=InstallRunTimeSystem:
好吧,我还没有时间测试这一切。但很快我就会做到了。也许需要付出一点努力才能启用任务分配。
I've found what maybe can be a clue for this. I was reading the AVR-Ada documentation in more detail, and I found this in Status area of AVR-Ada Sourceforge documentation http://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=Status:
So, the tasking feature is not enabled/available at first. Going deeper in the documentation, I found this in http://sourceforge.net/apps/mediawiki/avr-ada/index.php?title=InstallRunTimeSystem:
Well, I did not have time yet to test all this. But soon I shall have done it. And maybe a little effort will be necessary to make tasking enabled.