- added 3rd party uart lib

- added measurements for voltage and current
This commit is contained in:
Lucas Pleß 2013-06-12 00:30:49 +02:00
parent 6d0e569a3f
commit b8402e32fc
12 changed files with 1922 additions and 344 deletions

6
display/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.lst
.eep
.hex
.lss
.map
.sym

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="" vcs="" /> <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component> </component>
</project> </project>

View File

@ -1,10 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9fad4545-a424-4a82-86dc-76602cf3eef3" name="Default" comment="" /> <list default="true" id="9fad4545-a424-4a82-86dc-76602cf3eef3" name="Default" comment="- added 3rd party uart lib&#10;- added measurements for voltage and current">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../.gitignore" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/powerboard/src/uart.c" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/powerboard/src/uart.h" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/powerboard/main.elf" afterPath="$PROJECT_DIR$/powerboard/main.elf" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/powerboard/.dep/main.o.d" afterPath="$PROJECT_DIR$/powerboard/.dep/main.o.d" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/powerboard/Makefile" afterPath="$PROJECT_DIR$/powerboard/Makefile" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/powerboard/src/main.c" afterPath="$PROJECT_DIR$/powerboard/src/main.c" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/powerboard/main.hex" afterPath="$PROJECT_DIR$/powerboard/main.hex" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/powerboard/src/main.lst" afterPath="$PROJECT_DIR$/powerboard/src/main.lst" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/powerboard/main.map" afterPath="$PROJECT_DIR$/powerboard/main.map" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/vcs.xml" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="bikegenerator.iws" /> <ignored path="bikegenerator.iws" />
<ignored path=".idea/workspace.xml" /> <ignored path=".idea/workspace.xml" />
<file path="/Makefile" changelist="9fad4545-a424-4a82-86dc-76602cf3eef3" time="1370954497482" ignored="false" /> <file path="/Makefile" changelist="9fad4545-a424-4a82-86dc-76602cf3eef3" time="1370979337668" ignored="false" />
<file path="/Dummy.txt" changelist="9fad4545-a424-4a82-86dc-76602cf3eef3" time="1370989786703" ignored="false" />
<option name="TRACKING_ENABLED" value="true" /> <option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -65,28 +79,10 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf> <leaf>
<file leaf-file-name="Makefile" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/displayboard/Makefile">
<provider selected="true" editor-type-id="text-editor">
<state line="19" column="28" selection-start="429" selection-end="429" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Makefile" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="Makefile" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/powerboard/Makefile"> <entry file="file://$PROJECT_DIR$/powerboard/Makefile">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="54" column="43" selection-start="1446" selection-end="1446" vertical-scroll-proportion="0.0"> <state line="44" column="5" selection-start="1201" selection-end="1201" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="adc.h" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/powerboard/src/adc.h">
<provider selected="true" editor-type-id="text-editor">
<state line="3" column="22" selection-start="52" selection-end="52" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -95,16 +91,7 @@
<file leaf-file-name="main.c" pinned="false" current="true" current-in-tab="true"> <file leaf-file-name="main.c" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/powerboard/src/main.c"> <entry file="file://$PROJECT_DIR$/powerboard/src/main.c">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="51" column="42" selection-start="1125" selection-end="1125" vertical-scroll-proportion="0.5403088"> <state line="14" column="53" selection-start="265" selection-end="265" vertical-scroll-proportion="-1.0426009">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="adc.c" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/powerboard/src/adc.c">
<provider selected="true" editor-type-id="text-editor">
<state line="2" column="0" selection-start="21" selection-end="21" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -117,22 +104,31 @@
<setting name="OPEN_NEW_TAB" value="false" /> <setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager> </FindUsagesManager>
</component> </component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
</component>
<component name="GitLogSettings">
<option name="myDateState">
<MyDateState />
</option>
</component>
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="changedFiles"> <option name="changedFiles">
<list> <list>
<option value="$PROJECT_DIR$/powerboard/src/adc.h" /> <option value="$PROJECT_DIR$/powerboard/src/adc.h" />
<option value="$PROJECT_DIR$/powerboard/Makefile" />
<option value="$PROJECT_DIR$/powerboard/src/adc.c" /> <option value="$PROJECT_DIR$/powerboard/src/adc.c" />
<option value="$PROJECT_DIR$/powerboard/Makefile" />
<option value="$PROJECT_DIR$/powerboard/src/main.c" /> <option value="$PROJECT_DIR$/powerboard/src/main.c" />
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="x" value="1596" /> <option name="x" value="-4" />
<option name="width" value="1928" /> <option name="y" value="25" />
<option name="height" value="1058" /> <option name="width" value="1608" />
<option name="height" value="853" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectLevelVcsManager" settingsEditedManually="true">
<OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" /> <OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" /> <OptionsSetting value="true" id="Checkout" />
@ -208,14 +204,19 @@
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="GoToFile.includeJavaFiles" value="false" /> <property name="GoToFile.includeJavaFiles" value="false" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="MemberChooser.sorted" value="false" />
<property name="recentsLimit" value="5" />
<property name="options.lastSelected" value="project.propVCSSupport.Mappings" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../.." />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" /> <property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="recentsLimit" value="5" />
<property name="MemberChooser.sorted" value="false" />
<property name="restartRequiresConfirmation" value="true" /> <property name="restartRequiresConfirmation" value="true" />
<property name="MemberChooser.showClasses" value="true" /> <property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" /> <property name="GoToClass.includeLibraries" value="false" />
<property name="MemberChooser.copyJavadoc" value="false" /> <property name="options.searchVisible" value="true" />
<property name="options.splitter.details.proportions" value="0.2" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
@ -324,6 +325,23 @@
</configuration> </configuration>
</component> </component>
<component name="ShelveChangesManager" show_recycled="false" /> <component name="ShelveChangesManager" show_recycled="false" />
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="all">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="mySSHConnectionTimeout" value="30000" />
<option name="mySSHReadTimeout" value="30000" />
<option name="LAST_MERGED_REVISION" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
<option name="IGNORE_EXTERNALS" value="false" />
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
</component>
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<changelist id="9fad4545-a424-4a82-86dc-76602cf3eef3" name="Default" comment="" /> <changelist id="9fad4545-a424-4a82-86dc-76602cf3eef3" name="Default" comment="" />
@ -333,31 +351,31 @@
<servers /> <servers />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="1596" y="0" width="1928" height="1058" extended-state="6" /> <frame x="-4" y="25" width="1608" height="853" extended-state="6" />
<editor active="true" /> <editor active="false" />
<layout> <layout>
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Changes" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.328125" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32893288" sideWeight="0.5" order="8" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32893288" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32893288" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="CDI" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="CDI" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2497332" sideWeight="0.6710671" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3011583" sideWeight="0.671875" order="0" side_tool="false" content_ui="combo" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
</layout> </layout>
</component> </component>
<component name="VcsContentAnnotationSettings"> <component name="VcsContentAnnotationSettings">
@ -446,13 +464,57 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/powerboard/src/adc.h">
<provider selected="true" editor-type-id="text-editor">
<state line="3" column="22" selection-start="52" selection-end="52" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/powerboard/src/utils.h">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/displayboard/Makefile"> <entry file="file://$PROJECT_DIR$/displayboard/Makefile">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="19" column="28" selection-start="429" selection-end="429" vertical-scroll-proportion="0.0"> <state line="19" column="28" selection-start="429" selection-end="429" vertical-scroll-proportion="0.06942393">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/powerboard/Makefile">
<provider selected="true" editor-type-id="text-editor">
<state line="44" column="5" selection-start="1201" selection-end="1201" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/powerboard/src/utils.c">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/powerboard/src/uart.h">
<provider selected="true" editor-type-id="text-editor">
<state line="63" column="24" selection-start="2405" selection-end="2421" vertical-scroll-proportion="-1.971935">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/powerboard/src/uart.c">
<provider selected="true" editor-type-id="text-editor">
<state line="233" column="37" selection-start="8699" selection-end="8700" vertical-scroll-proportion="-0.38403615">
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/powerboard/src/adc.c"> <entry file="file://$PROJECT_DIR$/powerboard/src/adc.c">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="2" column="0" selection-start="21" selection-end="21" vertical-scroll-proportion="0.0"> <state line="2" column="0" selection-start="21" selection-end="21" vertical-scroll-proportion="0.0">
@ -460,23 +522,9 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/powerboard/src/adc.h">
<provider selected="true" editor-type-id="text-editor">
<state line="3" column="22" selection-start="52" selection-end="52" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/powerboard/Makefile">
<provider selected="true" editor-type-id="text-editor">
<state line="54" column="43" selection-start="1446" selection-end="1446" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/powerboard/src/main.c"> <entry file="file://$PROJECT_DIR$/powerboard/src/main.c">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="51" column="42" selection-start="1125" selection-end="1125" vertical-scroll-proportion="0.5403088"> <state line="14" column="53" selection-start="265" selection-end="265" vertical-scroll-proportion="-1.0426009">
<folding /> <folding />
</state> </state>
</provider> </provider>

View File

@ -12,7 +12,7 @@ src/main.o: src/main.c \
/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/lock.h \ /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/lock.h \
/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/interrupt.h \ /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/interrupt.h \
/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/pgmspace.h \ /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/pgmspace.h \
/usr/lib/gcc/avr/4.5.3/include/stddef.h src/utils.h src/adc.h /usr/lib/gcc/avr/4.5.3/include/stddef.h src/utils.h src/adc.h src/uart.h
/usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/io.h: /usr/lib/gcc/avr/4.5.3/../../../avr/include/avr/io.h:
@ -45,3 +45,5 @@ src/main.o: src/main.c \
src/utils.h: src/utils.h:
src/adc.h: src/adc.h:
src/uart.h:

View File

@ -52,7 +52,7 @@ TARGET = main
# List C source files here. (C dependencies are automatically generated.) # List C source files here. (C dependencies are automatically generated.)
SRC = src/$(TARGET).c src/adc.c src/utils.c SRC = src/$(TARGET).c src/adc.c src/utils.c src/uart.c
# List Assembler source files here. # List Assembler source files here.
@ -180,7 +180,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
AVRDUDE_PROGRAMMER = usbasp AVRDUDE_PROGRAMMER = usbasp
# com1 = serial port. Use lpt1 to connect to parallel port. # com1 = serial port. Use lpt1 to connect to parallel port.
AVRDUDE_PORT = AVRDUDE_PORT = usb
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep

Binary file not shown.

View File

@ -1,27 +1,126 @@
:1000000012C021C020C01FC01EC01DC03EC01BC0EA :1000000030C03FC03EC03DC03CC03BC02AC139C02B
:100010001AC019C018C017C016C015C014C013C02C :1000100038C037C036C08CC1B7C133C032C031C060
:1000200012C011C010C011241FBECFE5D4E0DEBF46 :1000200030C02FC02EC0570D0A006D412020004760
:10003000CDBF10E0A0E6B0E001C01D92A236B1072E :10003000656E657261746F723A2000570D0A006D2B
:10004000E1F71FD0ABC0DCCF8EB58B608EBD82EEEA :10004000412020004C6F61643A20202020202000B5
:1000500094E09BBD8ABD80E189BF7894089587B301 :1000500064560D0A00566F6C746167653A20202063
:10006000876087BB88B3887F88BB089580E0089548 :10006000000011241FBECFE5D4E0DEBFCDBF10E0FD
:10007000882311F481E001C080E064E034D080E0A6 :10007000A0E6B0E001C01D92AD3AB107E1F75FD054
:100080000895EDDF19D0E0DFFFCF1F920F920FB67A :10008000A1C3BECF8EB58B608EBD82EE94E09BBDCA
:100090000F9211248F939F93809160009091610043 :100090008ABD80E189BF7894089587B3876087BB64
:1000A000019690936100809360009F918F910F90D3 :1000A00088B3887F88BB0895CF93DF9382E064E0B4
:1000B0000FBE0F901F90189580E487B983E086B932 :1000B00006D1BC0180E090E07FD223E333E343ED3F
:1000C000379A369A3699FECF84B195B1089597B193 :1000C00050E4E6D14DD2709363006093620081E00A
:1000D0008F71907E892B87B9369A3699FECF24B1DD :1000D00064E0F5D09C012E5F3140C8E4D0E02C9F55
:1000E00035B1C9010895BF92CF92DF92EF92FF928E :1000E000C0012D9F900D3C9F900D112490936500B1
:1000F0000F931F93D82EB62ECC24EE24FF24870115 :1000F0008093640080E064E0E2D09C012F5F314097
:100100000AC08D2DE4DFAC0160E070E0E40EF51E66 :100100002C9FC0012D9F900D3C9F900D112490932A
:10011000061F171FC394CB14A0F32B2D30E040E033 :10011000670080936600DF91CF910895FC01CB01C9
:1001200050E0C801B70118D0C9011F910F91FF908D :1001200024E630E0B901EAD26E9FC0016F9F900DC6
:10013000EF90DF90CF90BF900895882309F484E674 :100130007E9F900D1124B901CDD2862F0895EF92A4
:1001400090E007C0E3ECF9E03197F1F700C0000060 :10014000FF920F931F93DF93CF93CDB7DEB72A971C
:100150009F5F9817B8F30895A1E21A2EAA1BBB1B44 :100150000FB6F894DEBF0FBECDBF9FDF99D092DF00
:10016000FD010DC0AA1FBB1FEE1FFF1FA217B30783 :1001600083E390E036D1C09AC19AC2988E010F5FA6
:10017000E407F50720F0A21BB30BE40BF50B661F99 :100170001F4F84E6E82EF12C97DF85E590E07BD1D8
:10018000771F881F991F1A9469F76095709580955D :100180008091620090916300B8014AE050E0EBD2A8
:1001900090959B01AC01BD01CF010895F894FFCF6C :100190005FD180E590E06FD184E490E06CD18091F4
:1001A000660090916700B8014AE050E0DCD250D17F
:1001B0008FE390E060D18091660090916700B70175
:1001C0009DD22091620030916300629FC001639FC5
:1001D000900D729F900D1124B7017CD2862F90E074
:1001E000B8014AE050E0BFD233D18BE390E043D175
:1001F0008FE290E040D18091640090916500B80159
:100200004AE050E0B0D224D18AE290E034D180912B
:10021000640090916500B70171D220916200309125
:100220006300629FC001639F900D729F900D112427
:10023000B70150D2862F90E0B8014AE050E093D247
:1002400007D186E290E017D184E663D084E661D0DE
:1002500084E65FD084E65DD084E65BD084E659D046
:100260008BCF1F920F920FB60F9211248F939F93F3
:10027000809160009091610001969093610080935D
:1002800060009F918F910F900FBE0F901F90189557
:1002900080E487B983E086B9379A369A3699FECFDB
:1002A00084B195B1089597B18F71907E892B87B9EC
:1002B000369A3699FECF24B135B1C9010895BF925F
:1002C000CF92DF92EF92FF920F931F93D82EB62E0C
:1002D000CC24EE24FF2487010AC08D2DE4DFAC017D
:1002E00060E070E0E40EF51E061F171FC394CB14E8
:1002F000A0F32B2D30E040E050E0C801B70111D24F
:10030000C9011F910F91FF90EF90DF90CF90BF90A8
:100310000895882309F484E690E007C0E3ECF9E04F
:100320003197F1F700C000009F5F9817B8F3089568
:100330001F920F920FB60F9211242F938F939F93BA
:10034000EF93FF939BB18CB1E0918A00EF5FEF7167
:1003500020918B00E21741F09871E0938A00F0E061
:10036000E457FF4F808301C092E08091AC00892B5D
:100370008093AC00FF91EF919F918F912F910F90FF
:100380000FBE0F901F9018951F920F920FB60F92ED
:1003900011248F939F93EF93FF9390916800809126
:1003A0006900981761F0E0916900EF5FEF71E093E9
:1003B0006900F0E0E659FF4F80818CB901C0559883
:1003C000FF91EF919F918F910F900FBE0F901F9013
:1003D0001895109268001092690010928A0010928D
:1003E0008B0097FF03C022E02BB99F7790BD89B99E
:1003F00088E98AB986E880BD089590918A00809145
:100400008B00981781F0E0918B00EF5FEF71E09324
:100410008B00F0E0E457FF4F20818091AC001092F8
:10042000AC0030E002C020E031E0C90108959091B5
:1004300068009F5F9F71209169009217E1F3E92F97
:10044000F0E0E659FF4F808390936800559A089535
:10045000EF92FF92CF93DF93E82EE7017E01F92E12
:10046000E70101C0E4DF89918823E1F7DF91CF91B3
:10047000FF90EF900895CF93DF93EC0101C0D7DF99
:10048000FE01219684918823D1F7DF91CF910895C1
:100490000CD0E6C0DED040F0D5D030F021F45F3F84
:1004A00019F0C7C0511110C1CAC0EBD098F39923FD
:1004B000C9F35523B1F3951B550BBB27AA27621728
:1004C0007307840738F09F5F5F4F220F331F441F6D
:1004D000AA1FA9F333D00E2E3AF0E0E830D09150A5
:1004E0005040E695001CCAF729D0FE2F27D0660F92
:1004F000771F881FBB1F261737074807AB07B0E8D1
:1005000009F0BB0B802DBF01FF2793585F4F2AF0E6
:100510009E3F510568F08DC0D7C05F3FECF3983E19
:10052000DCF3869577956795B795F7959F5FC9F743
:10053000880F911D9695879597F90895E1E0660FCC
:10054000771F881FBB1F621773078407BA0720F045
:10055000621B730B840BBA0BEE1F88F7E0950895AE
:1005600098D088F09F5790F0B92F9927B751A0F0F5
:10057000D1F0660F771F881F991F1AF0BA95C9F737
:1005800012C0B13081F09FD0B1E008959CC0672FB8
:10059000782F8827B85F39F0B93FCCF386957795E7
:1005A0006795B395D9F73EF49095809570956195D0
:1005B0007F4F8F4F9F4F0895E89409C097FB3EF4FB
:1005C00090958095709561957F4F8F4F9F4F9923A0
:1005D000A9F0F92F96E9BB279395F695879577951E
:1005E0006795B795F111F8CFFAF4BB0F11F460FFDE
:1005F0001BC06F5F7F4F8F4F9F4F16C0882311F036
:1006000096E911C0772321F09EE8872F762F05C049
:10061000662371F096E8862F70E060E02AF09A95E4
:10062000660F771F881FDAF7880F9695879597F9D9
:10063000089597F99F6780E870E060E008959FEF64
:1006400080EC089500240A94161617061806090669
:10065000089500240A941216130614060506089538
:10066000092E0394000C11F4882352F0BB0F40F4C0
:10067000BF2B11F460FF04C06F5F7F4F8F4F9F4F00
:10068000089557FD9058440F551F59F05F3F71F082
:100690004795880F97FB991F61F09F3F79F08795E9
:1006A0000895121613061406551FF2CF4695F1DF72
:1006B00008C0161617061806991FF1CF8695710502
:1006C000610508940895E894BB2766277727CB0136
:1006D00097F90895AA1BBB1B51E107C0AA1FBB1FB6
:1006E000A617B70710F0A61BB70B881F991F5A95BE
:1006F000A9F780959095BC01CD01089597FB092E2F
:1007000007260AD077FD04D0E5DF06D000201AF4D2
:10071000709561957F4F0895F6F7909581959F4F5D
:100720000895A1E21A2EAA1BBB1BFD010DC0AA1F32
:10073000BB1FEE1FFF1FA217B307E407F50720F04A
:10074000A21BB30BE40BF50B661F771F881F991FC5
:100750001A9469F760957095809590959B01AC010E
:10076000BD01CF010895FB019F01E8944230BCF028
:100770004532ACF44A3029F497FB1EF490958195EC
:100780009F4F642F7727A6DF805D8A330CF0895D49
:100790008193CB010097A9F716F45DE25193108283
:1007A000C90100C0DC01FC01672F71917723E1F7DB
:1007B000329704C07C916D9370836291AE17BF072E
:0807C000C8F30895F894FFCF7F
:00000001FF :00000001FF

View File

@ -1,11 +1,41 @@
Archive member included because of file (symbol) Archive member included because of file (symbol)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
src/main.o (__divsf3)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o) (__divsf3x)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
src/main.o (__fixunssfsi)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(floatsisf.o)
src/main.o (__floatunsisf)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_inf.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o) (__fp_inf)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_nan.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o) (__fp_nan)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscA.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o) (__fp_pscA)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscB.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o) (__fp_pscB)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_round.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o) (__fp_round)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_split3.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o) (__fp_split3)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_zero.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o) (__fp_zero)
/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodhi4.o)
src/main.o (__udivmodhi4)
/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_divmodhi4.o)
src/main.o (__divmodhi4)
/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o)
src/adc.o (__udivmodsi4) src/adc.o (__udivmodsi4)
/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o (exit) /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o (exit)
/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
src/main.o (__do_clear_bss) src/main.o (__do_clear_bss)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
src/main.o (itoa)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(strrev.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o) (strrev)
Memory Configuration Memory Configuration
@ -24,6 +54,7 @@ LOAD /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
LOAD src/main.o LOAD src/main.o
LOAD src/adc.o LOAD src/adc.o
LOAD src/utils.o LOAD src/utils.o
LOAD src/uart.o
LOAD /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a LOAD /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a
LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
LOAD /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a LOAD /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a
@ -119,7 +150,7 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
.rela.plt .rela.plt
*(.rela.plt) *(.rela.plt)
.text 0x0000000000000000 0x1a0 .text 0x0000000000000000 0x7c8
*(.vectors) *(.vectors)
.vectors 0x0000000000000000 0x26 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .vectors 0x0000000000000000 0x26 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
0x0000000000000000 __vectors 0x0000000000000000 __vectors
@ -127,38 +158,40 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
*(.vectors) *(.vectors)
*(.progmem.gcc*) *(.progmem.gcc*)
*(.progmem*) *(.progmem*)
0x0000000000000026 . = ALIGN (0x2) .progmem.data 0x0000000000000026 0x3b src/main.o
0x0000000000000026 __trampolines_start = . 0x0000000000000062 . = ALIGN (0x2)
*fill* 0x0000000000000061 0x1 00
0x0000000000000062 __trampolines_start = .
*(.trampolines) *(.trampolines)
.trampolines 0x0000000000000026 0x0 linker stubs .trampolines 0x0000000000000062 0x0 linker stubs
*(.trampolines*) *(.trampolines*)
0x0000000000000026 __trampolines_end = . 0x0000000000000062 __trampolines_end = .
*(.jumptables) *(.jumptables)
*(.jumptables*) *(.jumptables*)
*(.lowtext) *(.lowtext)
*(.lowtext*) *(.lowtext*)
0x0000000000000026 __ctors_start = . 0x0000000000000062 __ctors_start = .
*(.ctors) *(.ctors)
0x0000000000000026 __ctors_end = . 0x0000000000000062 __ctors_end = .
0x0000000000000026 __dtors_start = . 0x0000000000000062 __dtors_start = .
*(.dtors) *(.dtors)
0x0000000000000026 __dtors_end = . 0x0000000000000062 __dtors_end = .
SORT(*)(.ctors) SORT(*)(.ctors)
SORT(*)(.dtors) SORT(*)(.dtors)
*(.init0) *(.init0)
.init0 0x0000000000000026 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .init0 0x0000000000000062 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
0x0000000000000026 __init 0x0000000000000062 __init
*(.init0) *(.init0)
*(.init1) *(.init1)
*(.init1) *(.init1)
*(.init2) *(.init2)
.init2 0x0000000000000026 0xc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .init2 0x0000000000000062 0xc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
*(.init2) *(.init2)
*(.init3) *(.init3)
*(.init3) *(.init3)
*(.init4) *(.init4)
.init4 0x0000000000000032 0x10 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) .init4 0x000000000000006e 0x10 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
0x0000000000000032 __do_clear_bss 0x000000000000006e __do_clear_bss
*(.init4) *(.init4)
*(.init5) *(.init5)
*(.init5) *(.init5)
@ -169,55 +202,124 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
*(.init8) *(.init8)
*(.init8) *(.init8)
*(.init9) *(.init9)
.init9 0x0000000000000042 0x4 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .init9 0x000000000000007e 0x4 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
*(.init9) *(.init9)
*(.text) *(.text)
.text 0x0000000000000046 0x2 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .text 0x0000000000000082 0x2 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
0x0000000000000046 __vector_1 0x0000000000000082 __vector_1
0x0000000000000046 __vector_12 0x0000000000000082 __bad_interrupt
0x0000000000000046 __bad_interrupt 0x0000000000000082 __vector_3
0x0000000000000046 __vector_3 0x0000000000000082 __vector_13
0x0000000000000046 __vector_11 0x0000000000000082 __vector_17
0x0000000000000046 __vector_13 0x0000000000000082 __vector_7
0x0000000000000046 __vector_17 0x0000000000000082 __vector_5
0x0000000000000046 __vector_7 0x0000000000000082 __vector_4
0x0000000000000046 __vector_5 0x0000000000000082 __vector_9
0x0000000000000046 __vector_4 0x0000000000000082 __vector_2
0x0000000000000046 __vector_9 0x0000000000000082 __vector_15
0x0000000000000046 __vector_2 0x0000000000000082 __vector_8
0x0000000000000046 __vector_15 0x0000000000000082 __vector_14
0x0000000000000046 __vector_8 0x0000000000000082 __vector_10
0x0000000000000046 __vector_14 0x0000000000000082 __vector_16
0x0000000000000046 __vector_10 0x0000000000000082 __vector_18
0x0000000000000046 __vector_16 .text 0x0000000000000084 0x20c src/main.o
0x0000000000000046 __vector_18 0x0000000000000084 timer_init
.text 0x0000000000000048 0x70 src/main.o 0x000000000000009a ports_init
0x0000000000000048 timer_init 0x00000000000000a8 measure
0x000000000000005e ports_init 0x000000000000011c get_power
0x000000000000006c get_voltage 0x000000000000013e main
0x0000000000000070 get_power 0x0000000000000262 __vector_6
0x0000000000000082 main .text 0x0000000000000290 0x82 src/adc.o
0x000000000000008a __vector_6 0x0000000000000290 adc_init
.text 0x00000000000000b8 0x82 src/adc.o 0x00000000000002a6 adc_read_single
0x00000000000000b8 adc_init 0x00000000000002be adc_read_avg
0x00000000000000ce adc_read_single .text 0x0000000000000312 0x1e src/utils.o
0x00000000000000e6 adc_read_avg 0x0000000000000312 wait
.text 0x000000000000013a 0x1e src/utils.o .text 0x0000000000000330 0x160 src/uart.o
0x000000000000013a wait 0x0000000000000330 __vector_11
.text 0x0000000000000158 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) 0x0000000000000388 __vector_12
.text 0x0000000000000158 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) 0x00000000000003d2 uart_init
.text 0x0000000000000158 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) 0x00000000000003fa uart_getc
0x0000000000000158 . = ALIGN (0x2) 0x000000000000042e uart_putc
0x0000000000000450 uart_puts
0x0000000000000476 uart_puts_p
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(floatsisf.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_inf.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_nan.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscA.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscB.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_round.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_split3.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_zero.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodhi4.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_divmodhi4.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
.text 0x0000000000000490 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(strrev.o)
0x0000000000000490 . = ALIGN (0x2)
*(.text.*) *(.text.*)
.text.libgcc 0x0000000000000158 0x44 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) .text.avr-libc.fplib
0x0000000000000158 __udivmodsi4 0x0000000000000490 0x4 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
.text.libgcc 0x000000000000019c 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) 0x0000000000000490 __divsf3
.text.libgcc 0x000000000000019c 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) .text.avr-libc.fplib
0x000000000000019c . = ALIGN (0x2) 0x0000000000000494 0xcc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
0x00000000000004aa __divsf3x
0x00000000000004ae __divsf3_pse
.text.avr-libc.fplib
0x0000000000000560 0x58 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
0x0000000000000560 __fixunssfsi
.text.avr-libc.fplib
0x00000000000005b8 0x7a /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(floatsisf.o)
0x00000000000005b8 __floatunsisf
0x00000000000005bc __floatsisf
.text.avr-libc.fplib
0x0000000000000632 0xc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_inf.o)
0x0000000000000632 __fp_inf
.text.avr-libc.fplib
0x000000000000063e 0x6 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_nan.o)
0x000000000000063e __fp_nan
.text.avr-libc.fplib
0x0000000000000644 0xe /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscA.o)
0x0000000000000644 __fp_pscA
.text.avr-libc.fplib
0x0000000000000652 0xe /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscB.o)
0x0000000000000652 __fp_pscB
.text.avr-libc.fplib
0x0000000000000660 0x22 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_round.o)
0x0000000000000660 __fp_round
.text.avr-libc.fplib
0x0000000000000682 0x44 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_split3.o)
0x0000000000000682 __fp_split3
0x0000000000000692 __fp_splitA
.text.avr-libc.fplib
0x00000000000006c6 0xe /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_zero.o)
0x00000000000006c6 __fp_zero
0x00000000000006c8 __fp_szero
.text.libgcc 0x00000000000006d4 0x28 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodhi4.o)
0x00000000000006d4 __udivmodhi4
.text.libgcc 0x00000000000006fc 0x26 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_divmodhi4.o)
0x00000000000006fc __divmodhi4
0x00000000000006fc _div
.text.libgcc 0x0000000000000722 0x44 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o)
0x0000000000000722 __udivmodsi4
.text.libgcc 0x0000000000000766 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
.text.libgcc 0x0000000000000766 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
.text.avr-libc
0x0000000000000766 0x3e /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
0x0000000000000766 itoa
.text.avr-libc
0x00000000000007a4 0x20 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(strrev.o)
0x00000000000007a4 strrev
0x00000000000007c4 . = ALIGN (0x2)
*(.fini9) *(.fini9)
.fini9 0x000000000000019c 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) .fini9 0x00000000000007c4 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
0x000000000000019c exit 0x00000000000007c4 exit
0x000000000000019c _exit 0x00000000000007c4 _exit
*(.fini9) *(.fini9)
*(.fini8) *(.fini8)
*(.fini8) *(.fini8)
@ -236,20 +338,36 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
*(.fini1) *(.fini1)
*(.fini1) *(.fini1)
*(.fini0) *(.fini0)
.fini0 0x000000000000019c 0x4 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) .fini0 0x00000000000007c4 0x4 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
*(.fini0) *(.fini0)
0x00000000000001a0 _etext = . 0x00000000000007c8 _etext = .
.data 0x0000000000800060 0x0 load address 0x00000000000001a0 .data 0x0000000000800060 0x0 load address 0x00000000000007c8
0x0000000000800060 PROVIDE (__data_start, .) 0x0000000000800060 PROVIDE (__data_start, .)
*(.data) *(.data)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
.data 0x0000000000800060 0x0 src/main.o .data 0x0000000000800060 0x0 src/main.o
.data 0x0000000000800060 0x0 src/adc.o .data 0x0000000000800060 0x0 src/adc.o
.data 0x0000000000800060 0x0 src/utils.o .data 0x0000000000800060 0x0 src/utils.o
.data 0x0000000000800060 0x0 src/uart.o
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(floatsisf.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_inf.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_nan.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscA.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscB.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_round.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_split3.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_zero.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodhi4.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_divmodhi4.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) .data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
.data 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(strrev.o)
*(.data*) *(.data*)
*(.rodata) *(.rodata)
*(.rodata*) *(.rodata*)
@ -258,29 +376,48 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
0x0000000000800060 _edata = . 0x0000000000800060 _edata = .
0x0000000000800060 PROVIDE (__data_end, .) 0x0000000000800060 PROVIDE (__data_end, .)
.bss 0x0000000000800060 0x2 .bss 0x0000000000800060 0x4d
0x0000000000800060 PROVIDE (__bss_start, .) 0x0000000000800060 PROVIDE (__bss_start, .)
*(.bss) *(.bss)
.bss 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .bss 0x0000000000800060 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
.bss 0x0000000000800060 0x2 src/main.o .bss 0x0000000000800060 0x8 src/main.o
0x0000000000800060 syscounter 0x0000000000800060 syscounter
.bss 0x0000000000800062 0x0 src/adc.o 0x0000000000800062 voltage
.bss 0x0000000000800062 0x0 src/utils.o 0x0000000000800064 ampere_in
.bss 0x0000000000800062 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) 0x0000000000800066 ampere_out
.bss 0x0000000000800062 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) .bss 0x0000000000800068 0x0 src/adc.o
.bss 0x0000000000800062 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) .bss 0x0000000000800068 0x0 src/utils.o
.bss 0x0000000000800068 0x45 src/uart.o
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(floatsisf.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_inf.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_nan.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscA.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscB.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_round.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_split3.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_zero.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodhi4.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_divmodhi4.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
.bss 0x00000000008000ad 0x0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(strrev.o)
*(.bss*) *(.bss*)
*(COMMON) *(COMMON)
0x0000000000800062 PROVIDE (__bss_end, .) 0x00000000008000ad PROVIDE (__bss_end, .)
0x00000000000001a0 __data_load_start = LOADADDR (.data) 0x00000000000007c8 __data_load_start = LOADADDR (.data)
0x00000000000001a0 __data_load_end = (__data_load_start + SIZEOF (.data)) 0x00000000000007c8 __data_load_end = (__data_load_start + SIZEOF (.data))
.noinit 0x0000000000800062 0x0 .noinit 0x00000000008000ad 0x0
0x0000000000800062 PROVIDE (__noinit_start, .) 0x00000000008000ad PROVIDE (__noinit_start, .)
*(.noinit*) *(.noinit*)
0x0000000000800062 PROVIDE (__noinit_end, .) 0x00000000008000ad PROVIDE (__noinit_end, .)
0x0000000000800062 _end = . 0x00000000008000ad _end = .
0x0000000000800062 PROVIDE (__heap_start, .) 0x00000000008000ad PROVIDE (__heap_start, .)
.eeprom 0x0000000000810000 0x0 .eeprom 0x0000000000810000 0x0
*(.eeprom*) *(.eeprom*)
@ -298,13 +435,39 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
.signature .signature
*(.signature*) *(.signature*)
.stab 0x0000000000000000 0x6cc .stab 0x0000000000000000 0x1938
*(.stab) *(.stab)
.stab 0x0000000000000000 0x6cc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .stab 0x0000000000000000 0x6cc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
.stab 0x00000000000006cc 0x48 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
0x54 (size before relaxing)
.stab 0x0000000000000714 0x510 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
0x51c (size before relaxing)
.stab 0x0000000000000c24 0x240 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
0x24c (size before relaxing)
.stab 0x0000000000000e64 0x318 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(floatsisf.o)
0x324 (size before relaxing)
.stab 0x000000000000117c 0x78 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_inf.o)
0x84 (size before relaxing)
.stab 0x00000000000011f4 0x54 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_nan.o)
0x60 (size before relaxing)
.stab 0x0000000000001248 0x84 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscA.o)
0x90 (size before relaxing)
.stab 0x00000000000012cc 0x84 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscB.o)
0x90 (size before relaxing)
.stab 0x0000000000001350 0xfc /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_round.o)
0x108 (size before relaxing)
.stab 0x000000000000144c 0x1d4 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_split3.o)
0x1e0 (size before relaxing)
.stab 0x0000000000001620 0x90 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_zero.o)
0x9c (size before relaxing)
.stab 0x00000000000016b0 0x1b0 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
0x1bc (size before relaxing)
.stab 0x0000000000001860 0xd8 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(strrev.o)
0xe4 (size before relaxing)
.stabstr 0x0000000000000000 0x54 .stabstr 0x0000000000000000 0x2b3
*(.stabstr) *(.stabstr)
.stabstr 0x0000000000000000 0x54 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o .stabstr 0x0000000000000000 0x2b3 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
.stab.excl .stab.excl
*(.stab.excl) *(.stab.excl)
@ -333,7 +496,7 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
.debug_sfnames .debug_sfnames
*(.debug_sfnames) *(.debug_sfnames)
.debug_aranges 0x0000000000000000 0x60 .debug_aranges 0x0000000000000000 0x80
*(.debug_aranges) *(.debug_aranges)
.debug_aranges .debug_aranges
0x0000000000000000 0x20 src/main.o 0x0000000000000000 0x20 src/main.o
@ -341,56 +504,67 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a
0x0000000000000020 0x20 src/adc.o 0x0000000000000020 0x20 src/adc.o
.debug_aranges .debug_aranges
0x0000000000000040 0x20 src/utils.o 0x0000000000000040 0x20 src/utils.o
.debug_aranges
0x0000000000000060 0x20 src/uart.o
.debug_pubnames .debug_pubnames
0x0000000000000000 0xd4 0x0000000000000000 0x173
*(.debug_pubnames) *(.debug_pubnames)
.debug_pubnames .debug_pubnames
0x0000000000000000 0x75 src/main.o 0x0000000000000000 0x9a src/main.o
.debug_pubnames .debug_pubnames
0x0000000000000075 0x44 src/adc.o 0x000000000000009a 0x44 src/adc.o
.debug_pubnames .debug_pubnames
0x00000000000000b9 0x1b src/utils.o 0x00000000000000de 0x1b src/utils.o
.debug_pubnames
0x00000000000000f9 0x7a src/uart.o
.debug_info 0x0000000000000000 0x40e .debug_info 0x0000000000000000 0x7a7
*(.debug_info) *(.debug_info)
.debug_info 0x0000000000000000 0x19c src/main.o .debug_info 0x0000000000000000 0x259 src/main.o
.debug_info 0x000000000000019c 0x136 src/adc.o .debug_info 0x0000000000000259 0x136 src/adc.o
.debug_info 0x00000000000002d2 0x13c src/utils.o .debug_info 0x000000000000038f 0x13c src/utils.o
.debug_info 0x00000000000004cb 0x2dc src/uart.o
*(.gnu.linkonce.wi.*) *(.gnu.linkonce.wi.*)
.debug_abbrev 0x0000000000000000 0x2a5 .debug_abbrev 0x0000000000000000 0x3d5
*(.debug_abbrev) *(.debug_abbrev)
.debug_abbrev 0x0000000000000000 0x113 src/main.o .debug_abbrev 0x0000000000000000 0x12a src/main.o
.debug_abbrev 0x0000000000000113 0xb4 src/adc.o .debug_abbrev 0x000000000000012a 0xb4 src/adc.o
.debug_abbrev 0x00000000000001c7 0xde src/utils.o .debug_abbrev 0x00000000000001de 0xde src/utils.o
.debug_abbrev 0x00000000000002bc 0x119 src/uart.o
.debug_line 0x0000000000000000 0x384 .debug_line 0x0000000000000000 0x6fb
*(.debug_line) *(.debug_line)
.debug_line 0x0000000000000000 0x144 src/main.o .debug_line 0x0000000000000000 0x252 src/main.o
.debug_line 0x0000000000000144 0x13b src/adc.o .debug_line 0x0000000000000252 0x13b src/adc.o
.debug_line 0x000000000000027f 0x105 src/utils.o .debug_line 0x000000000000038d 0x105 src/utils.o
.debug_line 0x0000000000000492 0x269 src/uart.o
.debug_frame 0x0000000000000000 0xd0 .debug_frame 0x0000000000000000 0x150
*(.debug_frame) *(.debug_frame)
.debug_frame 0x0000000000000000 0x70 src/main.o .debug_frame 0x0000000000000000 0x70 src/main.o
.debug_frame 0x0000000000000070 0x40 src/adc.o .debug_frame 0x0000000000000070 0x40 src/adc.o
.debug_frame 0x00000000000000b0 0x20 src/utils.o .debug_frame 0x00000000000000b0 0x20 src/utils.o
.debug_frame 0x00000000000000d0 0x80 src/uart.o
.debug_str 0x0000000000000000 0x1cd .debug_str 0x0000000000000000 0x2bf
*(.debug_str) *(.debug_str)
.debug_str 0x0000000000000000 0x116 src/main.o .debug_str 0x0000000000000000 0x114 src/main.o
0x159 (size before relaxing) 0x155 (size before relaxing)
.debug_str 0x0000000000000116 0x56 src/adc.o .debug_str 0x0000000000000114 0x56 src/adc.o
0x11a (size before relaxing) 0x11a (size before relaxing)
.debug_str 0x000000000000016c 0x61 src/utils.o .debug_str 0x000000000000016a 0x61 src/utils.o
0x12e (size before relaxing) 0x12e (size before relaxing)
.debug_str 0x00000000000001cb 0xf4 src/uart.o
0x1c9 (size before relaxing)
.debug_loc 0x0000000000000000 0x17b .debug_loc 0x0000000000000000 0x3f3
*(.debug_loc) *(.debug_loc)
.debug_loc 0x0000000000000000 0x1e src/main.o .debug_loc 0x0000000000000000 0xac src/main.o
.debug_loc 0x000000000000001e 0xcf src/adc.o .debug_loc 0x00000000000000ac 0xcf src/adc.o
.debug_loc 0x00000000000000ed 0x8e src/utils.o .debug_loc 0x000000000000017b 0x8e src/utils.o
.debug_loc 0x0000000000000209 0x1ea src/uart.o
.debug_macinfo .debug_macinfo
*(.debug_macinfo) *(.debug_macinfo)
@ -398,13 +572,18 @@ OUTPUT(main.elf elf32-avr)
LOAD linker stubs LOAD linker stubs
.debug_pubtypes .debug_pubtypes
0x0000000000000000 0xac 0x0000000000000000 0xd2
.debug_pubtypes .debug_pubtypes
0x0000000000000000 0x3c src/main.o 0x0000000000000000 0x37 src/main.o
.debug_pubtypes .debug_pubtypes
0x000000000000003c 0x38 src/adc.o 0x0000000000000037 0x38 src/adc.o
.debug_pubtypes .debug_pubtypes
0x0000000000000074 0x38 src/utils.o 0x000000000000006f 0x38 src/utils.o
.debug_pubtypes
0x00000000000000a7 0x2b src/uart.o
.debug_ranges 0x0000000000000000 0x18
.debug_ranges 0x0000000000000000 0x18 src/main.o
Cross Reference Table Cross Reference Table
@ -412,17 +591,54 @@ Symbol File
__bad_interrupt /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __bad_interrupt /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__bss_end /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) __bss_end /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
__bss_start /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) __bss_start /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
__do_clear_bss /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o) __divmodhi4 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_divmodhi4.o)
src/main.o src/main.o
__divsf3 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
src/main.o
__divsf3_pse /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
__divsf3x /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
__do_clear_bss /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_clear_bss.o)
src/uart.o
src/main.o
__fixunssfsi /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
src/main.o
__floatsisf /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(floatsisf.o)
__floatunsisf /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(floatsisf.o)
src/main.o
__fp_inf /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_inf.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
__fp_nan /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_nan.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
__fp_pscA /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscA.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
__fp_pscB /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_pscB.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
__fp_round /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_round.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3.o)
__fp_split3 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_split3.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
__fp_splitA /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_split3.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
__fp_szero /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_zero.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(divsf3x.o)
__fp_zero /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fp_zero.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libm.a(fixunssfsi.o)
__heap_end /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __heap_end /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__init /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __init /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__stack /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __stack /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__udivmodhi4 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodhi4.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
/usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_divmodhi4.o)
src/main.o
__udivmodsi4 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o) __udivmodsi4 /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_udivmodsi4.o)
src/adc.o src/adc.o
__vector_1 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vector_1 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__vector_10 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vector_10 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__vector_11 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vector_11 src/uart.o
__vector_12 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__vector_12 src/uart.o
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__vector_13 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vector_13 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__vector_14 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vector_14 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__vector_15 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vector_15 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
@ -440,19 +656,36 @@ __vector_8 /usr/lib/gcc/avr/4.5.3/../../.
__vector_9 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vector_9 /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__vector_default /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vector_default /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
__vectors /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o __vectors /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
_div /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_divmodhi4.o)
_exit /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) _exit /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
adc_init src/adc.o adc_init src/adc.o
src/main.o src/main.o
adc_read_avg src/adc.o adc_read_avg src/adc.o
src/main.o src/main.o
adc_read_single src/adc.o adc_read_single src/adc.o
ampere_in src/main.o
ampere_out src/main.o
exit /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o) exit /usr/lib/gcc/avr/4.5.3/avr4/libgcc.a(_exit.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
get_power src/main.o get_power src/main.o
get_voltage src/main.o itoa /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
src/main.o
main src/main.o main src/main.o
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/crtm8.o
measure src/main.o
ports_init src/main.o ports_init src/main.o
strrev /usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(strrev.o)
/usr/lib/gcc/avr/4.5.3/../../../avr/lib/avr4/libc.a(itoa.o)
syscounter src/main.o syscounter src/main.o
timer_init src/main.o timer_init src/main.o
uart_getc src/uart.o
uart_init src/uart.o
src/main.o
uart_putc src/uart.o
uart_puts src/uart.o
src/main.o
uart_puts_p src/uart.o
src/main.o
voltage src/main.o
wait src/utils.o wait src/utils.o
src/main.o

View File

@ -3,6 +3,7 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <utils.h> #include <utils.h>
#include "adc.h" #include "adc.h"
#include "uart.h"
#define AD_I_LOAD 0 #define AD_I_LOAD 0
#define AD_I_GEN 1 #define AD_I_GEN 1
@ -28,6 +29,9 @@ typedef enum {
volatile uint16_t syscounter = 0; volatile uint16_t syscounter = 0;
uint16_t voltage = 0;
int16_t current_in = 0;
int16_t current_out = 0;
void timer_init(void) { void timer_init(void) {
// clock is 8MHz // clock is 8MHz
@ -42,26 +46,20 @@ void ports_init(void) {
PORT_SW &= ~(_BV(LOADSW) | _BV(GENSW) | _BV(DUMPSW)); PORT_SW &= ~(_BV(LOADSW) | _BV(GENSW) | _BV(DUMPSW));
} }
uint8_t get_voltage(void) { void measure(void) {
// voltage has a divider (12V - 56k - ADC - 27k - GND) voltage = adc_read_avg(AD_V, 4) / 6.6;
// so
uint8_t voltage = 0;
return voltage; current_in = adc_read_avg(AD_I_GEN, 4);
current_in -= 510;
current_in *= 72;
current_out = adc_read_avg(AD_I_LOAD, 4);
current_out -= 511;
current_out *= 72;
} }
uint8_t get_power(power_source source) { uint8_t get_power(uint16_t voltage, int16_t currents) {
return (voltage * (currents/100)) / 100;
uint16_t voltage = get_voltage();
uint16_t amperes;
if(source == generated) {
amperes = adc_read_avg(AD_I_GEN, 4);
} else {
amperes = adc_read_avg(AD_I_LOAD, 4);
}
return 0;
} }
@ -71,10 +69,51 @@ int main(void) {
adc_init(); adc_init();
timer_init(); timer_init();
uart_init(UART_BAUD_SELECT(9600,F_OSC));
char s[10];
LOAD_ON;
GEN_ON;
DUMP_OFF;
while(1) { while(1) {
measure();
uart_puts_P("Voltage: ");
uart_puts ( itoa ( voltage, s, 10 ) );
uart_puts_P("dV\r\n");
uart_puts_P("Load: ");
uart_puts ( itoa ( current_out, s, 10 ) );
uart_puts_P("mA ");
uart_puts ( itoa ( get_power(voltage, current_out), s, 10 ) );
uart_puts_P("W\r\n");
uart_puts_P("Generator: ");
uart_puts ( itoa ( current_in, s, 10 ) );
uart_puts_P("mA ");
uart_puts ( itoa ( get_power(voltage, current_in), s, 10 ) );
uart_puts_P("W\r\n");
wait(100);
wait(100);
wait(100);
wait(100);
//wait(100);
//wait(100);
wait(100);
wait(100);
} }
return(0); return(0);

View File

@ -28,7 +28,7 @@
36 0010 89BF out 89-32,r24 36 0010 89BF out 89-32,r24
37 .LM5: 37 .LM5:
38 /* #APP */ 38 /* #APP */
39 ; 37 "src/main.c" 1 39 ; 41 "src/main.c" 1
40 0012 7894 sei 40 0012 7894 sei
41 ; 0 "" 2 41 ; 0 "" 2
42 /* epilogue start */ 42 /* epilogue start */
@ -56,120 +56,413 @@
66 .LM10: 66 .LM10:
67 0022 0895 ret 67 0022 0895 ret
68 .LFE1: 68 .LFE1:
70 .global get_voltage 70 .global measure
72 get_voltage: 72 measure:
73 .LFB2: 73 .LFB2:
74 .LM11: 74 .LM11:
75 /* prologue: function */ 75 0024 CF93 push r28
76 /* frame size = 0 */ 76 0026 DF93 push r29
77 /* stack size = 0 */ 77 /* prologue: function */
78 .L__stack_usage = 0 78 /* frame size = 0 */
79 .LVL0: 79 /* stack size = 2 */
80 .LM12: 80 .L__stack_usage = 2
81 0024 80E0 ldi r24,lo8(0) 81 .LM12:
82 /* epilogue start */ 82 0028 82E0 ldi r24,lo8(2)
83 0026 0895 ret 83 002a 64E0 ldi r22,lo8(4)
84 .LFE2: 84 002c 00D0 rcall adc_read_avg
86 .global get_power 85 002e BC01 movw r22,r24
88 get_power: 86 0030 80E0 ldi r24,lo8(0)
89 .LFB3: 87 0032 90E0 ldi r25,hi8(0)
90 .LM13: 88 0034 00D0 rcall __floatunsisf
91 .LVL1: 89 0036 23E3 ldi r18,lo8(0x40d33333)
92 /* prologue: function */ 90 0038 33E3 ldi r19,hi8(0x40d33333)
93 /* frame size = 0 */ 91 003a 43ED ldi r20,hlo8(0x40d33333)
94 /* stack size = 0 */ 92 003c 50E4 ldi r21,hhi8(0x40d33333)
95 .L__stack_usage = 0 93 003e 00D0 rcall __divsf3
96 .LM14: 94 0040 00D0 rcall __fixunssfsi
97 0028 8823 tst r24 95 0042 7093 0000 sts voltage+1,r23
98 002a 01F4 brne .L5 96 0046 6093 0000 sts voltage,r22
99 .LM15: 97 .LM13:
100 002c 81E0 ldi r24,lo8(1) 98 004a 81E0 ldi r24,lo8(1)
101 .LVL2: 99 004c 64E0 ldi r22,lo8(4)
102 002e 00C0 rjmp .L7 100 004e 00D0 rcall adc_read_avg
103 .LVL3: 101 .LM14:
104 .L5: 102 0050 9C01 movw r18,r24
105 .LM16: 103 0052 2E5F subi r18,lo8(-(-510))
106 0030 80E0 ldi r24,lo8(0) 104 0054 3140 sbci r19,hi8(-(-510))
107 .LVL4: 105 .LM15:
108 .L7: 106 0056 C8E4 ldi r28,lo8(72)
109 0032 64E0 ldi r22,lo8(4) 107 0058 D0E0 ldi r29,hi8(72)
110 0034 00D0 rcall adc_read_avg 108 005a 2C9F mul r18,r28
111 .LM17: 109 005c C001 movw r24,r0
112 0036 80E0 ldi r24,lo8(0) 110 005e 2D9F mul r18,r29
113 /* epilogue start */ 111 0060 900D add r25,r0
114 0038 0895 ret 112 0062 3C9F mul r19,r28
115 .LFE3: 113 0064 900D add r25,r0
117 .global main 114 0066 1124 clr r1
119 main: 115 0068 9093 0000 sts ampere_in+1,r25
120 .LFB4: 116 006c 8093 0000 sts ampere_in,r24
121 .LM18: 117 .LM16:
122 /* prologue: function */ 118 0070 80E0 ldi r24,lo8(0)
123 /* frame size = 0 */ 119 0072 64E0 ldi r22,lo8(4)
124 /* stack size = 0 */ 120 0074 00D0 rcall adc_read_avg
125 .L__stack_usage = 0 121 .LM17:
126 .LM19: 122 0076 9C01 movw r18,r24
127 003a 00D0 rcall ports_init 123 0078 2F5F subi r18,lo8(-(-511))
128 .LM20: 124 007a 3140 sbci r19,hi8(-(-511))
129 003c 00D0 rcall adc_init 125 .LM18:
130 .LM21: 126 007c 2C9F mul r18,r28
131 003e 00D0 rcall timer_init 127 007e C001 movw r24,r0
132 .L9: 128 0080 2D9F mul r18,r29
133 0040 00C0 rjmp .L9 129 0082 900D add r25,r0
134 .LFE4: 130 0084 3C9F mul r19,r28
136 .global __vector_6 131 0086 900D add r25,r0
138 __vector_6: 132 0088 1124 clr r1
139 .LFB5: 133 008a 9093 0000 sts ampere_out+1,r25
140 .LM22: 134 008e 8093 0000 sts ampere_out,r24
141 0042 1F92 push __zero_reg__ 135 /* epilogue start */
142 0044 0F92 push r0 136 .LM19:
143 0046 0FB6 in r0,__SREG__ 137 0092 DF91 pop r29
144 0048 0F92 push r0 138 0094 CF91 pop r28
145 004a 1124 clr __zero_reg__ 139 0096 0895 ret
146 004c 8F93 push r24 140 .LFE2:
147 004e 9F93 push r25 142 .global get_power
148 /* prologue: Signal */ 144 get_power:
145 .LFB3:
146 .LM20:
147 .LVL0:
148 /* prologue: function */
149 /* frame size = 0 */ 149 /* frame size = 0 */
150 /* stack size = 5 */ 150 /* stack size = 0 */
151 .L__stack_usage = 5 151 .L__stack_usage = 0
152 .LM23: 152 0098 FC01 movw r30,r24
153 0050 8091 0000 lds r24,syscounter 153 009a CB01 movw r24,r22
154 0054 9091 0000 lds r25,syscounter+1 154 .LVL1:
155 0058 0196 adiw r24,1 155 .LM21:
156 005a 9093 0000 sts syscounter+1,r25 156 009c 24E6 ldi r18,lo8(100)
157 005e 8093 0000 sts syscounter,r24 157 009e 30E0 ldi r19,hi8(100)
158 /* epilogue start */ 158 00a0 B901 movw r22,r18
159 .LM24: 159 .LVL2:
160 0062 9F91 pop r25 160 00a2 00D0 rcall __divmodhi4
161 0064 8F91 pop r24 161 .LVL3:
162 0066 0F90 pop r0 162 00a4 6E9F mul r22,r30
163 0068 0FBE out __SREG__,r0 163 00a6 C001 movw r24,r0
164 006a 0F90 pop r0 164 00a8 6F9F mul r22,r31
165 006c 1F90 pop __zero_reg__ 165 00aa 900D add r25,r0
166 006e 1895 reti 166 00ac 7E9F mul r23,r30
167 .LFE5: 167 00ae 900D add r25,r0
169 .global syscounter 168 00b0 1124 clr r1
170 .global syscounter 169 00b2 B901 movw r22,r18
171 .section .bss 170 00b4 00D0 rcall __udivmodhi4
174 syscounter: 171 .LM22:
175 0000 0000 .skip 2,0 172 00b6 862F mov r24,r22
240 .Letext0: 173 /* epilogue start */
174 00b8 0895 ret
175 .LFE3:
177 .global main
179 main:
180 .LFB4:
181 .LM23:
182 00ba EF92 push r14
183 00bc FF92 push r15
184 00be 0F93 push r16
185 00c0 1F93 push r17
186 00c2 DF93 push r29
187 00c4 CF93 push r28
188 00c6 CDB7 in r28,__SP_L__
189 00c8 DEB7 in r29,__SP_H__
190 00ca 2A97 sbiw r28,10
191 00cc 0FB6 in __tmp_reg__,__SREG__
192 00ce F894 cli
193 00d0 DEBF out __SP_H__,r29
194 00d2 0FBE out __SREG__,__tmp_reg__
195 00d4 CDBF out __SP_L__,r28
196 /* prologue: function */
197 /* frame size = 10 */
198 /* stack size = 16 */
199 .L__stack_usage = 16
200 .LM24:
201 00d6 00D0 rcall ports_init
202 .LM25:
203 00d8 00D0 rcall adc_init
204 .LM26:
205 00da 00D0 rcall timer_init
206 .LM27:
207 00dc 83E3 ldi r24,lo8(51)
208 00de 90E0 ldi r25,hi8(51)
209 00e0 00D0 rcall uart_init
210 .LM28:
211 00e2 C09A sbi 56-32,0
212 .LM29:
213 00e4 C19A sbi 56-32,1
214 .LM30:
215 00e6 C298 cbi 56-32,2
216 .LBB15:
217 .LM31:
218 00e8 8E01 movw r16,r28
219 00ea 0F5F subi r16,lo8(-(1))
220 00ec 1F4F sbci r17,hi8(-(1))
221 .LBB16:
222 .LBB17:
223 .LM32:
224 00ee 84E6 ldi r24,lo8(100)
225 00f0 E82E mov r14,r24
226 00f2 F12C mov r15,__zero_reg__
227 .L6:
228 .LBE17:
229 .LBE16:
230 .LM33:
231 00f4 00D0 rcall measure
232 .LM34:
233 00f6 80E0 ldi r24,lo8(__c.1470)
234 00f8 90E0 ldi r25,hi8(__c.1470)
235 00fa 00D0 rcall uart_puts_p
236 .LM35:
237 00fc 8091 0000 lds r24,voltage
238 0100 9091 0000 lds r25,voltage+1
239 0104 B801 movw r22,r16
240 0106 4AE0 ldi r20,lo8(10)
241 0108 50E0 ldi r21,hi8(10)
242 010a 00D0 rcall itoa
243 010c 00D0 rcall uart_puts
244 .LM36:
245 010e 80E0 ldi r24,lo8(__c.1473)
246 0110 90E0 ldi r25,hi8(__c.1473)
247 0112 00D0 rcall uart_puts_p
248 .LM37:
249 0114 80E0 ldi r24,lo8(__c.1475)
250 0116 90E0 ldi r25,hi8(__c.1475)
251 0118 00D0 rcall uart_puts_p
252 .LM38:
253 011a 8091 0000 lds r24,ampere_out
254 011e 9091 0000 lds r25,ampere_out+1
255 0122 B801 movw r22,r16
256 0124 4AE0 ldi r20,lo8(10)
257 0126 50E0 ldi r21,hi8(10)
258 0128 00D0 rcall itoa
259 012a 00D0 rcall uart_puts
260 .LM39:
261 012c 80E0 ldi r24,lo8(__c.1477)
262 012e 90E0 ldi r25,hi8(__c.1477)
263 0130 00D0 rcall uart_puts_p
264 .LVL4:
265 .LBB19:
266 .LBB18:
267 .LM40:
268 0132 8091 0000 lds r24,ampere_out
269 0136 9091 0000 lds r25,ampere_out+1
270 013a B701 movw r22,r14
271 013c 00D0 rcall __divmodhi4
272 013e 2091 0000 lds r18,voltage
273 0142 3091 0000 lds r19,voltage+1
274 0146 629F mul r22,r18
275 0148 C001 movw r24,r0
276 014a 639F mul r22,r19
277 014c 900D add r25,r0
278 014e 729F mul r23,r18
279 0150 900D add r25,r0
280 0152 1124 clr r1
281 0154 B701 movw r22,r14
282 0156 00D0 rcall __udivmodhi4
283 .LBE18:
284 .LBE19:
285 .LM41:
286 0158 862F mov r24,r22
287 015a 90E0 ldi r25,lo8(0)
288 015c B801 movw r22,r16
289 015e 4AE0 ldi r20,lo8(10)
290 0160 50E0 ldi r21,hi8(10)
291 0162 00D0 rcall itoa
292 .LVL5:
293 0164 00D0 rcall uart_puts
294 .LM42:
295 0166 80E0 ldi r24,lo8(__c.1479)
296 0168 90E0 ldi r25,hi8(__c.1479)
297 016a 00D0 rcall uart_puts_p
298 .LM43:
299 016c 80E0 ldi r24,lo8(__c.1481)
300 016e 90E0 ldi r25,hi8(__c.1481)
301 0170 00D0 rcall uart_puts_p
302 .LM44:
303 0172 8091 0000 lds r24,ampere_in
304 0176 9091 0000 lds r25,ampere_in+1
305 017a B801 movw r22,r16
306 017c 4AE0 ldi r20,lo8(10)
307 017e 50E0 ldi r21,hi8(10)
308 0180 00D0 rcall itoa
309 0182 00D0 rcall uart_puts
310 .LM45:
311 0184 80E0 ldi r24,lo8(__c.1483)
312 0186 90E0 ldi r25,hi8(__c.1483)
313 0188 00D0 rcall uart_puts_p
314 .LVL6:
315 .LBB20:
316 .LBB21:
317 .LM46:
318 018a 8091 0000 lds r24,ampere_in
319 018e 9091 0000 lds r25,ampere_in+1
320 0192 B701 movw r22,r14
321 0194 00D0 rcall __divmodhi4
322 0196 2091 0000 lds r18,voltage
323 019a 3091 0000 lds r19,voltage+1
324 019e 629F mul r22,r18
325 01a0 C001 movw r24,r0
326 01a2 639F mul r22,r19
327 01a4 900D add r25,r0
328 01a6 729F mul r23,r18
329 01a8 900D add r25,r0
330 01aa 1124 clr r1
331 01ac B701 movw r22,r14
332 01ae 00D0 rcall __udivmodhi4
333 .LBE21:
334 .LBE20:
335 .LM47:
336 01b0 862F mov r24,r22
337 01b2 90E0 ldi r25,lo8(0)
338 01b4 B801 movw r22,r16
339 01b6 4AE0 ldi r20,lo8(10)
340 01b8 50E0 ldi r21,hi8(10)
341 01ba 00D0 rcall itoa
342 .LVL7:
343 01bc 00D0 rcall uart_puts
344 .LM48:
345 01be 80E0 ldi r24,lo8(__c.1485)
346 01c0 90E0 ldi r25,hi8(__c.1485)
347 01c2 00D0 rcall uart_puts_p
348 .LM49:
349 01c4 84E6 ldi r24,lo8(100)
350 01c6 00D0 rcall wait
351 .LM50:
352 01c8 84E6 ldi r24,lo8(100)
353 01ca 00D0 rcall wait
354 .LM51:
355 01cc 84E6 ldi r24,lo8(100)
356 01ce 00D0 rcall wait
357 .LM52:
358 01d0 84E6 ldi r24,lo8(100)
359 01d2 00D0 rcall wait
360 .LM53:
361 01d4 84E6 ldi r24,lo8(100)
362 01d6 00D0 rcall wait
363 .LM54:
364 01d8 84E6 ldi r24,lo8(100)
365 01da 00D0 rcall wait
366 01dc 00C0 rjmp .L6
367 .LBE15:
368 .LFE4:
370 .global __vector_6
372 __vector_6:
373 .LFB5:
374 .LM55:
375 01de 1F92 push __zero_reg__
376 01e0 0F92 push r0
377 01e2 0FB6 in r0,__SREG__
378 01e4 0F92 push r0
379 01e6 1124 clr __zero_reg__
380 01e8 8F93 push r24
381 01ea 9F93 push r25
382 /* prologue: Signal */
383 /* frame size = 0 */
384 /* stack size = 5 */
385 .L__stack_usage = 5
386 .LM56:
387 01ec 8091 0000 lds r24,syscounter
388 01f0 9091 0000 lds r25,syscounter+1
389 01f4 0196 adiw r24,1
390 01f6 9093 0000 sts syscounter+1,r25
391 01fa 8093 0000 sts syscounter,r24
392 /* epilogue start */
393 .LM57:
394 01fe 9F91 pop r25
395 0200 8F91 pop r24
396 0202 0F90 pop r0
397 0204 0FBE out __SREG__,r0
398 0206 0F90 pop r0
399 0208 1F90 pop __zero_reg__
400 020a 1895 reti
401 .LFE5:
403 .global syscounter
404 .global syscounter
405 .section .bss
408 syscounter:
409 0000 0000 .skip 2,0
410 .global voltage
411 .global voltage
414 voltage:
415 0002 0000 .skip 2,0
416 .global ampere_in
417 .global ampere_in
420 ampere_in:
421 0004 0000 .skip 2,0
422 .global ampere_out
423 .global ampere_out
426 ampere_out:
427 0006 0000 .skip 2,0
428 .section .progmem.data,"a",@progbits
431 __c.1485:
432 0000 570D 0A00 .string "W\r\n"
435 __c.1483:
436 0004 6D41 2020 .string "mA "
436 00
439 __c.1481:
440 0009 4765 6E65 .string "Generator: "
440 7261 746F
440 723A 2000
443 __c.1479:
444 0015 570D 0A00 .string "W\r\n"
447 __c.1477:
448 0019 6D41 2020 .string "mA "
448 00
451 __c.1475:
452 001e 4C6F 6164 .string "Load: "
452 3A20 2020
452 2020 2000
455 __c.1473:
456 002a 6456 0D0A .string "dV\r\n"
456 00
459 __c.1470:
460 002f 566F 6C74 .string "Voltage: "
460 6167 653A
460 2020 2000
525 .Letext0:
DEFINED SYMBOLS DEFINED SYMBOLS
*ABS*:0000000000000000 main.c *ABS*:0000000000000000 main.c
/tmp/cc5sOhJc.s:2 *ABS*:000000000000003f __SREG__ /tmp/ccTFX6lH.s:2 *ABS*:000000000000003f __SREG__
/tmp/cc5sOhJc.s:3 *ABS*:000000000000003e __SP_H__ /tmp/ccTFX6lH.s:3 *ABS*:000000000000003e __SP_H__
/tmp/cc5sOhJc.s:4 *ABS*:000000000000003d __SP_L__ /tmp/ccTFX6lH.s:4 *ABS*:000000000000003d __SP_L__
/tmp/cc5sOhJc.s:5 *ABS*:0000000000000034 __CCP__ /tmp/ccTFX6lH.s:5 *ABS*:0000000000000034 __CCP__
/tmp/cc5sOhJc.s:6 *ABS*:0000000000000000 __tmp_reg__ /tmp/ccTFX6lH.s:6 *ABS*:0000000000000000 __tmp_reg__
/tmp/cc5sOhJc.s:7 *ABS*:0000000000000001 __zero_reg__ /tmp/ccTFX6lH.s:7 *ABS*:0000000000000001 __zero_reg__
/tmp/cc5sOhJc.s:18 .text:0000000000000000 timer_init /tmp/ccTFX6lH.s:18 .text:0000000000000000 timer_init
/tmp/cc5sOhJc.s:50 .text:0000000000000016 ports_init /tmp/ccTFX6lH.s:50 .text:0000000000000016 ports_init
/tmp/cc5sOhJc.s:72 .text:0000000000000024 get_voltage /tmp/ccTFX6lH.s:72 .text:0000000000000024 measure
/tmp/cc5sOhJc.s:88 .text:0000000000000028 get_power /tmp/ccTFX6lH.s:414 .bss:0000000000000002 voltage
/tmp/cc5sOhJc.s:119 .text:000000000000003a main /tmp/ccTFX6lH.s:420 .bss:0000000000000004 ampere_in
/tmp/cc5sOhJc.s:138 .text:0000000000000042 __vector_6 /tmp/ccTFX6lH.s:426 .bss:0000000000000006 ampere_out
/tmp/cc5sOhJc.s:174 .bss:0000000000000000 syscounter /tmp/ccTFX6lH.s:144 .text:0000000000000098 get_power
/tmp/ccTFX6lH.s:179 .text:00000000000000ba main
/tmp/ccTFX6lH.s:459 .progmem.data:000000000000002f __c.1470
/tmp/ccTFX6lH.s:455 .progmem.data:000000000000002a __c.1473
/tmp/ccTFX6lH.s:451 .progmem.data:000000000000001e __c.1475
/tmp/ccTFX6lH.s:447 .progmem.data:0000000000000019 __c.1477
/tmp/ccTFX6lH.s:443 .progmem.data:0000000000000015 __c.1479
/tmp/ccTFX6lH.s:439 .progmem.data:0000000000000009 __c.1481
/tmp/ccTFX6lH.s:435 .progmem.data:0000000000000004 __c.1483
/tmp/ccTFX6lH.s:431 .progmem.data:0000000000000000 __c.1485
/tmp/ccTFX6lH.s:372 .text:00000000000001de __vector_6
/tmp/ccTFX6lH.s:408 .bss:0000000000000000 syscounter
UNDEFINED SYMBOLS UNDEFINED SYMBOLS
adc_read_avg adc_read_avg
__floatunsisf
__divsf3
__fixunssfsi
__divmodhi4
__udivmodhi4
adc_init adc_init
uart_init
uart_puts_p
itoa
uart_puts
wait
__do_clear_bss __do_clear_bss

View File

@ -0,0 +1,663 @@
/*************************************************************************
Title: Interrupt UART library with receive/transmit circular buffers
Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
File: $Id: uart.c,v 1.10 2013/06/02 07:27:04 peter Exp $
Software: AVR-GCC 4.1, AVR Libc 1.4.6 or higher
Hardware: any AVR with built-in UART,
License: GNU General Public License
DESCRIPTION:
An interrupt is generated when the UART has finished transmitting or
receiving a byte. The interrupt handling routines use circular buffers
for buffering received and transmitted data.
The UART_RX_BUFFER_SIZE and UART_TX_BUFFER_SIZE variables define
the buffer size in bytes. Note that these variables must be a
power of 2.
USAGE:
Refere to the header file uart.h for a description of the routines.
See also example test_uart.c.
NOTES:
Based on Atmel Application Note AVR306
LICENSE:
Copyright (C) 2006 Peter Fleury
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
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*************************************************************************/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "uart.h"
/*
* constants and macros
*/
/* size of RX/TX buffers */
#define UART_RX_BUFFER_MASK ( UART_RX_BUFFER_SIZE - 1)
#define UART_TX_BUFFER_MASK ( UART_TX_BUFFER_SIZE - 1)
#if ( UART_RX_BUFFER_SIZE & UART_RX_BUFFER_MASK )
#error RX buffer size is not a power of 2
#endif
#if ( UART_TX_BUFFER_SIZE & UART_TX_BUFFER_MASK )
#error TX buffer size is not a power of 2
#endif
#if defined(__AVR_AT90S2313__) \
|| defined(__AVR_AT90S4414__) || defined(__AVR_AT90S4434__) \
|| defined(__AVR_AT90S8515__) || defined(__AVR_AT90S8535__) \
|| defined(__AVR_ATmega103__)
/* old AVR classic or ATmega103 with one UART */
#define AT90_UART
#define UART0_RECEIVE_INTERRUPT UART_RX_vect
#define UART0_TRANSMIT_INTERRUPT UART_UDRE_vect
#define UART0_STATUS USR
#define UART0_CONTROL UCR
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_AT90S2333__) || defined(__AVR_AT90S4433__)
/* old AVR classic with one UART */
#define AT90_UART
#define UART0_RECEIVE_INTERRUPT UART_RX_vect
#define UART0_TRANSMIT_INTERRUPT UART_UDRE_vect
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega8__) || defined(__AVR_ATmega16__) || defined(__AVR_ATmega32__) \
|| defined(__AVR_ATmega323__)
/* ATmega with one USART */
#define ATMEGA_USART
#define UART0_RECEIVE_INTERRUPT USART_RXC_vect
#define UART0_TRANSMIT_INTERRUPT USART_UDRE_vect
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined (__AVR_ATmega8515__) || defined(__AVR_ATmega8535__)
#define ATMEGA_USART
#define UART0_RECEIVE_INTERRUPT USART_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART_UDRE_vect
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega163__)
/* ATmega163 with one UART */
#define ATMEGA_UART
#define UART0_RECEIVE_INTERRUPT UART_RX_vect
#define UART0_TRANSMIT_INTERRUPT UART_UDRE_vect
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega162__)
/* ATmega with two USART */
#define ATMEGA_USART0
#define ATMEGA_USART1
#define UART0_RECEIVE_INTERRUPT USART0_RXC_vect
#define UART1_RECEIVE_INTERRUPT USART1_RXC_vect
#define UART0_TRANSMIT_INTERRUPT USART0_UDRE_vect
#define UART1_TRANSMIT_INTERRUPT USART1_UDRE_vect
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#define UART1_STATUS UCSR1A
#define UART1_CONTROL UCSR1B
#define UART1_DATA UDR1
#define UART1_UDRIE UDRIE1
#elif defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__)
/* ATmega with two USART */
#define ATMEGA_USART0
#define ATMEGA_USART1
#define UART0_RECEIVE_INTERRUPT USART0_RX_vect
#define UART1_RECEIVE_INTERRUPT USART1_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART0_UDRE_vect
#define UART1_TRANSMIT_INTERRUPT USART1_UDRE_vect
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#define UART1_STATUS UCSR1A
#define UART1_CONTROL UCSR1B
#define UART1_DATA UDR1
#define UART1_UDRIE UDRIE1
#elif defined(__AVR_ATmega161__)
/* ATmega with UART */
#error "AVR ATmega161 currently not supported by this libaray !"
#elif defined(__AVR_ATmega169__)
/* ATmega with one USART */
#define ATMEGA_USART
#define UART0_RECEIVE_INTERRUPT USART0_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART0_UDRE_vect
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega88P__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) \
|| defined(__AVR_ATmega3250__) || defined(__AVR_ATmega3290__) ||defined(__AVR_ATmega6450__) || defined(__AVR_ATmega6490__)
/* ATmega with one USART */
#define ATMEGA_USART0
#define UART0_RECEIVE_INTERRUPT USART_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART_UDRE_vect
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#elif defined(__AVR_ATtiny2313__)
#define ATMEGA_USART
#define UART0_RECEIVE_INTERRUPT USART_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART_UDRE_vect
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega329__) || \
defined(__AVR_ATmega649__) || \
defined(__AVR_ATmega325__) || \
defined(__AVR_ATmega645__)
/* ATmega with one USART */
#define ATMEGA_USART0
#define UART0_RECEIVE_INTERRUPT USART0_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART0_UDRE_vect
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) || defined(__AVR_ATmega640__)
/* ATmega with two USART */
#define ATMEGA_USART0
#define ATMEGA_USART1
#define UART0_RECEIVE_INTERRUPT USART0_RX_vect
#define UART1_RECEIVE_INTERRUPT USART1_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART0_UDRE_vect
#define UART1_TRANSMIT_INTERRUPT USART1_UDRE_vect
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#define UART1_STATUS UCSR1A
#define UART1_CONTROL UCSR1B
#define UART1_DATA UDR1
#define UART1_UDRIE UDRIE1
#elif defined(__AVR_ATmega644__)
/* ATmega with one USART */
#define ATMEGA_USART0
#define UART0_RECEIVE_INTERRUPT USART0_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART0_UDRE_vect
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#elif defined(__AVR_ATmega164P__) || defined(__AVR_ATmega324P__) || defined(__AVR_ATmega644P__)
/* ATmega with two USART */
#define ATMEGA_USART0
#define ATMEGA_USART1
#define UART0_RECEIVE_INTERRUPT USART0_RX_vect
#define UART1_RECEIVE_INTERRUPT USART1_RX_vect
#define UART0_TRANSMIT_INTERRUPT USART0_UDRE_vect
#define UART1_TRANSMIT_INTERRUPT USART1_UDRE_vect
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#define UART1_STATUS UCSR1A
#define UART1_CONTROL UCSR1B
#define UART1_DATA UDR1
#define UART1_UDRIE UDRIE1
#else
#error "no UART definition for MCU available"
#endif
/*
* module global variables
*/
static volatile unsigned char UART_TxBuf[UART_TX_BUFFER_SIZE];
static volatile unsigned char UART_RxBuf[UART_RX_BUFFER_SIZE];
static volatile unsigned char UART_TxHead;
static volatile unsigned char UART_TxTail;
static volatile unsigned char UART_RxHead;
static volatile unsigned char UART_RxTail;
static volatile unsigned char UART_LastRxError;
#if defined( ATMEGA_USART1 )
static volatile unsigned char UART1_TxBuf[UART_TX_BUFFER_SIZE];
static volatile unsigned char UART1_RxBuf[UART_RX_BUFFER_SIZE];
static volatile unsigned char UART1_TxHead;
static volatile unsigned char UART1_TxTail;
static volatile unsigned char UART1_RxHead;
static volatile unsigned char UART1_RxTail;
static volatile unsigned char UART1_LastRxError;
#endif
ISR (UART0_RECEIVE_INTERRUPT)
/*************************************************************************
Function: UART Receive Complete interrupt
Purpose: called when the UART has received a character
**************************************************************************/
{
unsigned char tmphead;
unsigned char data;
unsigned char usr;
unsigned char lastRxError;
/* read UART status register and UART data register */
usr = UART0_STATUS;
data = UART0_DATA;
/* */
#if defined( AT90_UART )
lastRxError = (usr & (_BV(FE)|_BV(DOR)) );
#elif defined( ATMEGA_USART )
lastRxError = (usr & (_BV(FE)|_BV(DOR)) );
#elif defined( ATMEGA_USART0 )
lastRxError = (usr & (_BV(FE0)|_BV(DOR0)) );
#elif defined ( ATMEGA_UART )
lastRxError = (usr & (_BV(FE)|_BV(DOR)) );
#endif
/* calculate buffer index */
tmphead = ( UART_RxHead + 1) & UART_RX_BUFFER_MASK;
if ( tmphead == UART_RxTail ) {
/* error: receive buffer overflow */
lastRxError = UART_BUFFER_OVERFLOW >> 8;
}else{
/* store new index */
UART_RxHead = tmphead;
/* store received data in buffer */
UART_RxBuf[tmphead] = data;
}
UART_LastRxError |= lastRxError;
}
ISR (UART0_TRANSMIT_INTERRUPT)
/*************************************************************************
Function: UART Data Register Empty interrupt
Purpose: called when the UART is ready to transmit the next byte
**************************************************************************/
{
unsigned char tmptail;
if ( UART_TxHead != UART_TxTail) {
/* calculate and store new buffer index */
tmptail = (UART_TxTail + 1) & UART_TX_BUFFER_MASK;
UART_TxTail = tmptail;
/* get one byte from buffer and write it to UART */
UART0_DATA = UART_TxBuf[tmptail]; /* start transmission */
}else{
/* tx buffer empty, disable UDRE interrupt */
UART0_CONTROL &= ~_BV(UART0_UDRIE);
}
}
/*************************************************************************
Function: uart_init()
Purpose: initialize UART and set baudrate
Input: baudrate using macro UART_BAUD_SELECT()
Returns: none
**************************************************************************/
void uart_init(unsigned int baudrate)
{
UART_TxHead = 0;
UART_TxTail = 0;
UART_RxHead = 0;
UART_RxTail = 0;
#if defined( AT90_UART )
/* set baud rate */
UBRR = (unsigned char)baudrate;
/* enable UART receiver and transmmitter and receive complete interrupt */
UART0_CONTROL = _BV(RXCIE)|_BV(RXEN)|_BV(TXEN);
#elif defined (ATMEGA_USART)
/* Set baud rate */
if ( baudrate & 0x8000 )
{
UART0_STATUS = (1<<U2X); //Enable 2x speed
baudrate &= ~0x8000;
}
UBRRH = (unsigned char)(baudrate>>8);
UBRRL = (unsigned char) baudrate;
/* Enable USART receiver and transmitter and receive complete interrupt */
UART0_CONTROL = _BV(RXCIE)|(1<<RXEN)|(1<<TXEN);
/* Set frame format: asynchronous, 8data, no parity, 1stop bit */
#ifdef URSEL
UCSRC = (1<<URSEL)|(3<<UCSZ0);
#else
UCSRC = (3<<UCSZ0);
#endif
#elif defined (ATMEGA_USART0 )
/* Set baud rate */
if ( baudrate & 0x8000 )
{
UART0_STATUS = (1<<U2X0); //Enable 2x speed
baudrate &= ~0x8000;
}
UBRR0H = (unsigned char)(baudrate>>8);
UBRR0L = (unsigned char) baudrate;
/* Enable USART receiver and transmitter and receive complete interrupt */
UART0_CONTROL = _BV(RXCIE0)|(1<<RXEN0)|(1<<TXEN0);
/* Set frame format: asynchronous, 8data, no parity, 1stop bit */
#ifdef URSEL0
UCSR0C = (1<<URSEL0)|(3<<UCSZ00);
#else
UCSR0C = (3<<UCSZ00);
#endif
#elif defined ( ATMEGA_UART )
/* set baud rate */
if ( baudrate & 0x8000 )
{
UART0_STATUS = (1<<U2X); //Enable 2x speed
baudrate &= ~0x8000;
}
UBRRHI = (unsigned char)(baudrate>>8);
UBRR = (unsigned char) baudrate;
/* Enable UART receiver and transmitter and receive complete interrupt */
UART0_CONTROL = _BV(RXCIE)|(1<<RXEN)|(1<<TXEN);
#endif
}/* uart_init */
/*************************************************************************
Function: uart_getc()
Purpose: return byte from ringbuffer
Returns: lower byte: received byte from ringbuffer
higher byte: last receive error
**************************************************************************/
unsigned int uart_getc(void)
{
unsigned char tmptail;
unsigned char data;
if ( UART_RxHead == UART_RxTail ) {
return UART_NO_DATA; /* no data available */
}
/* calculate /store buffer index */
tmptail = (UART_RxTail + 1) & UART_RX_BUFFER_MASK;
UART_RxTail = tmptail;
/* get data from receive buffer */
data = UART_RxBuf[tmptail];
data = (UART_LastRxError << 8) + data;
UART_LastRxError = 0;
return data;
}/* uart_getc */
/*************************************************************************
Function: uart_putc()
Purpose: write byte to ringbuffer for transmitting via UART
Input: byte to be transmitted
Returns: none
**************************************************************************/
void uart_putc(unsigned char data)
{
unsigned char tmphead;
tmphead = (UART_TxHead + 1) & UART_TX_BUFFER_MASK;
while ( tmphead == UART_TxTail ){
;/* wait for free space in buffer */
}
UART_TxBuf[tmphead] = data;
UART_TxHead = tmphead;
/* enable UDRE interrupt */
UART0_CONTROL |= _BV(UART0_UDRIE);
}/* uart_putc */
/*************************************************************************
Function: uart_puts()
Purpose: transmit string to UART
Input: string to be transmitted
Returns: none
**************************************************************************/
void uart_puts(const char *s )
{
while (*s)
uart_putc(*s++);
}/* uart_puts */
/*************************************************************************
Function: uart_puts_p()
Purpose: transmit string from program memory to UART
Input: program memory string to be transmitted
Returns: none
**************************************************************************/
void uart_puts_p(const char *progmem_s )
{
register char c;
while ( (c = pgm_read_byte(progmem_s++)) )
uart_putc(c);
}/* uart_puts_p */
/*
* these functions are only for ATmegas with two USART
*/
#if defined( ATMEGA_USART1 )
ISR(UART1_RECEIVE_INTERRUPT)
/*************************************************************************
Function: UART1 Receive Complete interrupt
Purpose: called when the UART1 has received a character
**************************************************************************/
{
unsigned char tmphead;
unsigned char data;
unsigned char usr;
unsigned char lastRxError;
/* read UART status register and UART data register */
usr = UART1_STATUS;
data = UART1_DATA;
/* */
lastRxError = (usr & (_BV(FE1)|_BV(DOR1)) );
/* calculate buffer index */
tmphead = ( UART1_RxHead + 1) & UART_RX_BUFFER_MASK;
if ( tmphead == UART1_RxTail ) {
/* error: receive buffer overflow */
lastRxError = UART_BUFFER_OVERFLOW >> 8;
}else{
/* store new index */
UART1_RxHead = tmphead;
/* store received data in buffer */
UART1_RxBuf[tmphead] = data;
}
UART1_LastRxError |= lastRxError;
}
ISR(UART1_TRANSMIT_INTERRUPT)
/*************************************************************************
Function: UART1 Data Register Empty interrupt
Purpose: called when the UART1 is ready to transmit the next byte
**************************************************************************/
{
unsigned char tmptail;
if ( UART1_TxHead != UART1_TxTail) {
/* calculate and store new buffer index */
tmptail = (UART1_TxTail + 1) & UART_TX_BUFFER_MASK;
UART1_TxTail = tmptail;
/* get one byte from buffer and write it to UART */
UART1_DATA = UART1_TxBuf[tmptail]; /* start transmission */
}else{
/* tx buffer empty, disable UDRE interrupt */
UART1_CONTROL &= ~_BV(UART1_UDRIE);
}
}
/*************************************************************************
Function: uart1_init()
Purpose: initialize UART1 and set baudrate
Input: baudrate using macro UART_BAUD_SELECT()
Returns: none
**************************************************************************/
void uart1_init(unsigned int baudrate)
{
UART1_TxHead = 0;
UART1_TxTail = 0;
UART1_RxHead = 0;
UART1_RxTail = 0;
/* Set baud rate */
if ( baudrate & 0x8000 )
{
UART1_STATUS = (1<<U2X1); //Enable 2x speed
baudrate &= ~0x8000;
}
UBRR1H = (unsigned char)(baudrate>>8);
UBRR1L = (unsigned char) baudrate;
/* Enable USART receiver and transmitter and receive complete interrupt */
UART1_CONTROL = _BV(RXCIE1)|(1<<RXEN1)|(1<<TXEN1);
/* Set frame format: asynchronous, 8data, no parity, 1stop bit */
#ifdef URSEL1
UCSR1C = (1<<URSEL1)|(3<<UCSZ10);
#else
UCSR1C = (3<<UCSZ10);
#endif
}/* uart_init */
/*************************************************************************
Function: uart1_getc()
Purpose: return byte from ringbuffer
Returns: lower byte: received byte from ringbuffer
higher byte: last receive error
**************************************************************************/
unsigned int uart1_getc(void)
{
unsigned char tmptail;
unsigned char data;
if ( UART1_RxHead == UART1_RxTail ) {
return UART_NO_DATA; /* no data available */
}
/* calculate /store buffer index */
tmptail = (UART1_RxTail + 1) & UART_RX_BUFFER_MASK;
UART1_RxTail = tmptail;
/* get data from receive buffer */
data = UART1_RxBuf[tmptail];
data = (UART1_LastRxError << 8) + data;
UART1_LastRxError = 0;
return data;
}/* uart1_getc */
/*************************************************************************
Function: uart1_putc()
Purpose: write byte to ringbuffer for transmitting via UART
Input: byte to be transmitted
Returns: none
**************************************************************************/
void uart1_putc(unsigned char data)
{
unsigned char tmphead;
tmphead = (UART1_TxHead + 1) & UART_TX_BUFFER_MASK;
while ( tmphead == UART1_TxTail ){
;/* wait for free space in buffer */
}
UART1_TxBuf[tmphead] = data;
UART1_TxHead = tmphead;
/* enable UDRE interrupt */
UART1_CONTROL |= _BV(UART1_UDRIE);
}/* uart1_putc */
/*************************************************************************
Function: uart1_puts()
Purpose: transmit string to UART1
Input: string to be transmitted
Returns: none
**************************************************************************/
void uart1_puts(const char *s )
{
while (*s)
uart1_putc(*s++);
}/* uart1_puts */
/*************************************************************************
Function: uart1_puts_p()
Purpose: transmit string from program memory to UART1
Input: program memory string to be transmitted
Returns: none
**************************************************************************/
void uart1_puts_p(const char *progmem_s )
{
register char c;
while ( (c = pgm_read_byte(progmem_s++)) )
uart1_putc(c);
}/* uart1_puts_p */
#endif

View File

@ -0,0 +1,195 @@
#ifndef UART_H
#define UART_H
/************************************************************************
Title: Interrupt UART library with receive/transmit circular buffers
Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
File: $Id: uart.h,v 1.12 2012/11/19 19:52:27 peter Exp $
Software: AVR-GCC 4.1, AVR Libc 1.4
Hardware: any AVR with built-in UART, tested on AT90S8515 & ATmega8 at 4 Mhz
License: GNU General Public License
Usage: see Doxygen manual
LICENSE:
Copyright (C) 2006 Peter Fleury
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
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
************************************************************************/
/**
* @defgroup pfleury_uart UART Library
* @code #include <uart.h> @endcode
*
* @brief Interrupt UART library using the built-in UART with transmit and receive circular buffers.
*
* This library can be used to transmit and receive data through the built in UART.
*
* An interrupt is generated when the UART has finished transmitting or
* receiving a byte. The interrupt handling routines use circular buffers
* for buffering received and transmitted data.
*
* The UART_RX_BUFFER_SIZE and UART_TX_BUFFER_SIZE constants define
* the size of the circular buffers in bytes. Note that these constants must be a power of 2.
* You may need to adapt this constants to your target and your application by adding
* CDEFS += -DUART_RX_BUFFER_SIZE=nn -DUART_RX_BUFFER_SIZE=nn to your Makefile.
*
* @note Based on Atmel Application Note AVR306
* @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
*/
/**@{*/
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
#endif
/*
** constants and macros
*/
/** @brief UART Baudrate Expression
* @param xtalcpu system clock in Mhz, e.g. 4000000UL for 4Mhz
* @param baudrate baudrate in bps, e.g. 1200, 2400, 9600
*/
#define UART_BAUD_SELECT(baudRate,xtalCpu) (((xtalCpu) + 8UL * (baudRate)) / (16UL * (baudRate)) -1UL)
/** @brief UART Baudrate Expression for ATmega double speed mode
* @param xtalcpu system clock in Mhz, e.g. 4000000UL for 4Mhz
* @param baudrate baudrate in bps, e.g. 1200, 2400, 9600
*/
#define UART_BAUD_SELECT_DOUBLE_SPEED(baudRate,xtalCpu) ( ((((xtalCpu) + 4UL * (baudRate)) / (8UL * (baudRate)) -1UL)) | 0x8000)
/** Size of the circular receive buffer, must be power of 2 */
#ifndef UART_RX_BUFFER_SIZE
#define UART_RX_BUFFER_SIZE 32
#endif
/** Size of the circular transmit buffer, must be power of 2 */
#ifndef UART_TX_BUFFER_SIZE
#define UART_TX_BUFFER_SIZE 32
#endif
/* test if the size of the circular buffers fits into SRAM */
#if ( (UART_RX_BUFFER_SIZE+UART_TX_BUFFER_SIZE) >= (RAMEND-0x60 ) )
#error "size of UART_RX_BUFFER_SIZE + UART_TX_BUFFER_SIZE larger than size of SRAM"
#endif
/*
** high byte error return code of uart_getc()
*/
#define UART_FRAME_ERROR 0x1000 /* Framing Error by UART */
#define UART_OVERRUN_ERROR 0x0800 /* Overrun condition by UART */
#define UART_PARITY_ERROR 0x0400 /* Parity Error by UART */
#define UART_BUFFER_OVERFLOW 0x0200 /* receive ringbuffer overflow */
#define UART_NO_DATA 0x0100 /* no receive data available */
/*
** function prototypes
*/
/**
@brief Initialize UART and set baudrate
@param baudrate Specify baudrate using macro UART_BAUD_SELECT()
@return none
*/
extern void uart_init(unsigned int baudrate);
/**
* @brief Get received byte from ringbuffer
*
* Returns in the lower byte the received character and in the
* higher byte the last receive error.
* UART_NO_DATA is returned when no data is available.
*
* @param void
* @return lower byte: received byte from ringbuffer
* @return higher byte: last receive status
* - \b 0 successfully received data from UART
* - \b UART_NO_DATA
* <br>no receive data available
* - \b UART_BUFFER_OVERFLOW
* <br>Receive ringbuffer overflow.
* We are not reading the receive buffer fast enough,
* one or more received character have been dropped
* - \b UART_OVERRUN_ERROR
* <br>Overrun condition by UART.
* A character already present in the UART UDR register was
* not read by the interrupt handler before the next character arrived,
* one or more received characters have been dropped.
* - \b UART_FRAME_ERROR
* <br>Framing Error by UART
*/
extern unsigned int uart_getc(void);
/**
* @brief Put byte to ringbuffer for transmitting via UART
* @param data byte to be transmitted
* @return none
*/
extern void uart_putc(unsigned char data);
/**
* @brief Put string to ringbuffer for transmitting via UART
*
* The string is buffered by the uart library in a circular buffer
* and one character at a time is transmitted to the UART using interrupts.
* Blocks if it can not write the whole string into the circular buffer.
*
* @param s string to be transmitted
* @return none
*/
extern void uart_puts(const char *s );
/**
* @brief Put string from program memory to ringbuffer for transmitting via UART.
*
* The string is buffered by the uart library in a circular buffer
* and one character at a time is transmitted to the UART using interrupts.
* Blocks if it can not write the whole string into the circular buffer.
*
* @param s program memory string to be transmitted
* @return none
* @see uart_puts_P
*/
extern void uart_puts_p(const char *s );
/**
* @brief Macro to automatically put a string constant into program memory
*/
#define uart_puts_P(__s) uart_puts_p(PSTR(__s))
/** @brief Initialize USART1 (only available on selected ATmegas) @see uart_init */
extern void uart1_init(unsigned int baudrate);
/** @brief Get received byte of USART1 from ringbuffer. (only available on selected ATmega) @see uart_getc */
extern unsigned int uart1_getc(void);
/** @brief Put byte to ringbuffer for transmitting via USART1 (only available on selected ATmega) @see uart_putc */
extern void uart1_putc(unsigned char data);
/** @brief Put string to ringbuffer for transmitting via USART1 (only available on selected ATmega) @see uart_puts */
extern void uart1_puts(const char *s );
/** @brief Put string from program memory to ringbuffer for transmitting via USART1 (only available on selected ATmega) @see uart_puts_p */
extern void uart1_puts_p(const char *s );
/** @brief Macro to automatically put a string constant into program memory */
#define uart1_puts_P(__s) uart1_puts_p(PSTR(__s))
/**@}*/
#endif // UART_H