From f508189682b6fba62e08feeb1596f682bad5fff9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 24 Feb 2010 18:42:24 +0000 Subject: Added KDE3 version of PikLab git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/tools/boost/boost_generator.cpp | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/tools/boost/boost_generator.cpp (limited to 'src/tools/boost/boost_generator.cpp') diff --git a/src/tools/boost/boost_generator.cpp b/src/tools/boost/boost_generator.cpp new file mode 100644 index 0000000..2fa1393 --- /dev/null +++ b/src/tools/boost/boost_generator.cpp @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (C) 2007 Nicolas Hadacek * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "boost_generator.h" + +#include "devices/pic/pic/pic_memory.h" + +//--------------------------------------------------------------------------- +SourceLine::List Boost::CSourceGenerator::configLines(PURL::ToolType, const Device::Memory &memory, bool &ok) const +{ + const Pic::Memory &pmemory = static_cast(memory); + const Pic::Data &data = pmemory.device(); + const Pic::Config &config = data.config(); + SourceLine::List lines; + Address address = data.range(Pic::MemoryRangeType::Config).start; + for (uint i=0; i"); + return lines; +} + +SourceLine::List Boost::CSourceGenerator::sourceFileContent(PURL::ToolType, const Device::Data &, bool &) const +{ + SourceLine::List lines; + lines.appendTitle(i18n("interrupt service routine")); + lines.appendNotIndentedCode("void interrupt(void) {"); + lines.appendIndentedCode(QString::null, "<< " + i18n("insert interrupt code") + " >>"); + lines.appendNotIndentedCode("}"); + lines.appendEmpty(); + lines.appendTitle(i18n("main program")); + lines.appendNotIndentedCode("void main() {"); + lines.appendIndentedCode(QString::null, "<< " + i18n("insert code") + " >>"); + lines.appendNotIndentedCode("}"); + return lines; +} + +//--------------------------------------------------------------------------- +SourceLine::List Boost::BasicSourceGenerator::configLines(PURL::ToolType, const Device::Memory &, bool &ok) const +{ + // config bits ? + ok = false; + return SourceLine::List(); +} + +SourceLine::List Boost::BasicSourceGenerator::includeLines(PURL::ToolType, const Device::Data &) const +{ + return SourceLine::List(); +} + +SourceLine::List Boost::BasicSourceGenerator::sourceFileContent(PURL::ToolType, const Device::Data &, bool &ok) const +{ + SourceLine::List lines; + ok = true; + lines.appendTitle(i18n("main program")); + lines.appendNotIndentedCode("Sub main()"); + lines.appendIndentedCode(QString::null, "<< " + i18n("insert code") + " >>"); + lines.appendIndentedCode("Do while 1", i18n("loop forever")); + lines.appendIndentedCode("Loop"); + lines.appendNotIndentedCode("End Sub"); + return lines; +} -- cgit v1.2.3