Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/.gitignore

This file was deleted.

18 changes: 18 additions & 0 deletions .github/actions/avr_setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Get changed files list"
description: "Setup Node with caching for dependencies"
runs:
using: "composite"
steps:
- name: Set up Arduino CLI
uses: arduino/setup-arduino-cli@v2

- name: Install platform
run: |
arduino-cli core update-index
arduino-cli core install ${{ env.platform }}
shell: bash

- name: Install popular libs
run: |
arduino-cli lib install LiquidCrystal
shell: bash
13 changes: 13 additions & 0 deletions .github/actions/get_changed_files/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Get changed files list"
description: "Setup Node with caching for dependencies"
runs:
using: "composite"
steps:
- name: Get changed files list
id: get_changed_files
run: |
echo "Changed files:"
git diff --name-only ${{ github.event.pull_request.base.sha }} > changed_files.txt
cat changed_files.txt
echo "The list is saved to changed_files.txt"
shell: bash
37 changes: 0 additions & 37 deletions .github/workflows/Lab_01_CI.yml

This file was deleted.

114 changes: 114 additions & 0 deletions .github/workflows/lab-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Cheking of compile Arduino sketch for AVR/AtMega

on:
pull_request:
branches: [main, master]

env:
platform: "arduino:avr"
fqbn_master: "arduino:avr:mega"
COMMIT_COUNT: $(( ${{ github.event_name == 'pull_request' && github.event.pull_request.commits || 0 }} + 1 ))

jobs:
handle_bad_branch_name:
runs-on: ubuntu-22.04
if: (contains(github.head_ref, 'mc_lab_1') || contains(github.head_ref, 'mc_lab_2') || contains(github.head_ref, 'mc_lab_3') || contains(github.head_ref, 'mc_lab_4') || contains(github.head_ref, 'mc_lab_5') || contains(github.head_ref, 'mc_lab_6') || contains(github.head_ref, 'mc_lab_7')) == false
steps:
- name: Fail the build
run: |
echo "The branch name is not correct. It should contain 'mc_lab_' prefix"
exit 1
build_labs_1_to_4:
runs-on: ubuntu-22.04
if: contains(github.head_ref, 'mc_lab_1') || contains(github.head_ref, 'mc_lab_2') || contains(github.head_ref, 'mc_lab_3') || contains(github.head_ref, 'mc_lab_4')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.COMMIT_COUNT }}

- name: Get changed files list
uses: ./.github/actions/get_changed_files

- name: Set up Arduino CLI
uses: ./.github/actions/avr_setup

- name: Compile Sketch
run: arduino-cli compile --fqbn ${{ env.fqbn_master }} $(grep -E '\.ino$' changed_files.txt | xargs)
build_lab_5:
runs-on: ubuntu-22.04
if: contains(github.head_ref, 'mc_lab_5')
env:
fqbn_slave: "arduino:avr:nano"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.COMMIT_COUNT }}

- name: Get changed files list
uses: ./.github/actions/get_changed_files

- name: Get master folder
run: |
cat changed_files.txt | xargs dirname | grep 'master' | grep -m 1 -vE '/(.*master.*|.*slave.*)/' > master_project.txt
echo "Master project:"
cat master_project.txt

- name: Get slave folders
run: |
cat changed_files.txt | xargs dirname | grep 'slave' | grep -vE '/(.*master.*|.*slave.*)/' > slave_projects.txt
echo "Slave projects:"
cat slave_projects.txt

- name: Check if there is at least one master and one slave project
run: |
if [ ! -s master_project.txt ] || [ ! -s slave_projects.txt ]; then
echo "There is no master or slave project"
exit 1
fi

- name: Set up Arduino CLI
uses: ./.github/actions/avr_setup

- name: Compile master
run: while read master_folder; do arduino-cli compile --fqbn ${{ env.fqbn_master }} $master_folder/*.ino; done < master_project.txt

- name: Compile slaves
run: while read slave_folder; do arduino-cli compile --fqbn ${{ env.fqbn_slave }} $slave_folder/*.ino; done < slave_projects.txt
build_lab_6:
runs-on: ubuntu-22.04
if: contains(github.head_ref, 'mc_lab_6')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.COMMIT_COUNT }}

- name: It just passes
run: echo "It just passes. It's too complex"
build_lab_7:
runs-on: ubuntu-22.04
if: contains(github.head_ref, 'mc_lab_7')
env:
register-bindings: "m2560def.inc"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.COMMIT_COUNT }}

- name: Get changed files list
uses: ./.github/actions/get_changed_files

- name: Setup AVRA Assembler
run: |
git clone https://github.com/Ro5bert/avra.git
cd avra
sudo make install

- name: Preprocess sketch - append register bindings to the top of the file
run: printf ".include \"${{ env.register-bindings }}\"\n\n" | cat - $(grep -m 1 -E '\.(asm|S)$' changed_files.txt | xargs) > pipeline_main_assembly_source_file.asm

- name: Compile Sketch
run: avra pipeline_main_assembly_source_file.asm
Binary file not shown.
22 changes: 22 additions & 0 deletions mc_labs/mc_lab_07/lab7-mko/avrstudio/lab7/lab7.atsln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Atmel Studio Solution File, Format Version 11.00
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{18226A42-8477-4023-8AD2-40C49DA407C9}") = "lab7", "lab7\lab7.asmproj", "{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|AVR = Debug|AVR
Release|AVR = Release|AVR
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}.Debug|AVR.ActiveCfg = Debug|AVR
{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}.Debug|AVR.Build.0 = Debug|AVR
{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}.Release|AVR.ActiveCfg = Release|AVR
{59B1D629-9DCC-43ED-A0FD-8AB0E4D622AB}.Release|AVR.Build.0 = Release|AVR
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
108 changes: 108 additions & 0 deletions mc_labs/mc_lab_07/lab7-mko/avrstudio/lab7/lab7/lab7.asmproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>7.0</ProjectVersion>
<ToolchainName>com.Atmel.AVRAssembler</ToolchainName>
<ProjectGuid>59B1D629-9DCC-43ed-A0FD-8AB0E4D622AB</ProjectGuid>
<avrdeviceseries>none</avrdeviceseries>
<avrdevice>ATmega2560</avrdevice>
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
<OutputFileExtension>.obj</OutputFileExtension>
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
<Language>ASSEMBLY</Language>
<AssemblyName>lab7</AssemblyName>
<Name>lab7</Name>
<RootNamespace>lab7</RootNamespace>
<ToolchainFlavour>Native</ToolchainFlavour>
<EntryFile>$(MSBuildProjectDirectory)\main.asm</EntryFile>
<KeepTimersRunning>true</KeepTimersRunning>
<OverrideVtor>false</OverrideVtor>
<CacheFlash>true</CacheFlash>
<ProgFlashFromRam>true</ProgFlashFromRam>
<RamSnippetAddress>0x20000000</RamSnippetAddress>
<UncachedRange />
<preserveEEPROM>true</preserveEEPROM>
<OverrideVtorValue>exception_table</OverrideVtorValue>
<BootSegment>2</BootSegment>
<ResetRule>0</ResetRule>
<eraseonlaunchrule>0</eraseonlaunchrule>
<EraseKey />
<AsfFrameworkConfig>
<framework-data xmlns="">
<options />
<configurations />
<files />
<documentation help="" />
<offline-documentation help="" />
<dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.52.0" />
</dependencies>
</framework-data>
</AsfFrameworkConfig>
<avrtool>com.atmel.avrdbg.tool.simulator</avrtool>
<avrtoolserialnumber />
<avrdeviceexpectedsignature>0x1E9801</avrdeviceexpectedsignature>
<com_atmel_avrdbg_tool_simulator>
<ToolOptions>
<InterfaceProperties>
</InterfaceProperties>
<InterfaceName>
</InterfaceName>
</ToolOptions>
<ToolType>com.atmel.avrdbg.tool.simulator</ToolType>
<ToolNumber>
</ToolNumber>
<ToolName>Simulator</ToolName>
</com_atmel_avrdbg_tool_simulator>
<avrtoolinterface />
<custom>
<ToolOptions xmlns="">
<InterfaceProperties>
</InterfaceProperties>
<InterfaceName>
</InterfaceName>
</ToolOptions>
<ToolType xmlns="">custom</ToolType>
<ToolNumber xmlns="">
</ToolNumber>
<ToolName xmlns="">Custom Programming Tool</ToolName>
</custom>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrAssembler>
<avrasm.assembler.general.AdditionalIncludeDirectories>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.7.374\avrasm\inc</Value>
</ListValues>
</avrasm.assembler.general.AdditionalIncludeDirectories>
<avrasm.assembler.general.IncludeFile>m2560def.inc</avrasm.assembler.general.IncludeFile>
</AvrAssembler>
</ToolchainSettings>
<OutputType>Executable</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<AvrAssembler>
<avrasm.assembler.general.AdditionalIncludeDirectories>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.7.374\avrasm\inc</Value>
</ListValues>
</avrasm.assembler.general.AdditionalIncludeDirectories>
<avrasm.assembler.general.IncludeFile>m2560def.inc</avrasm.assembler.general.IncludeFile>
</AvrAssembler>
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile Include="main.asm">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="lab7.pdsprj">
<SubType>Code</SubType>
</None>
</ItemGroup>
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Assembler.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
<ProjectComponents>
<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
<CApiVersion></CApiVersion>
<CBundle></CBundle>
<CClass>Device</CClass>
<CGroup>Startup</CGroup>
<CSub></CSub>
<CVariant></CVariant>
<CVendor>Atmel</CVendor>
<CVersion>1.7.0</CVersion>
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<Description></Description>
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.7.374\avrasm\inc</AbsolutePath>
<Attribute></Attribute>
<Category>include</Category>
<Condition>AVRASM</Condition>
<FileContentHash i:nil="true" />
<FileVersion></FileVersion>
<Name>avrasm/inc</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.7.374\avrasm\inc\m2560def.inc</AbsolutePath>
<Attribute></Attribute>
<Category>header</Category>
<Condition>AVRASM</Condition>
<FileContentHash>WfTdCEu0AkLjvEGIJEiVXg==</FileContentHash>
<FileVersion></FileVersion>
<Name>avrasm/inc/m2560def.inc</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType i:type="FileInfo">
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.7.374\avrasm\templates\main.asm</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>AVRASM</Condition>
<FileContentHash>S4Kwzy8TT0G4DKwdWeyoAw==</FileContentHash>
<FileVersion></FileVersion>
<Name>avrasm/templates/main.asm</Name>
<SelectString>Main file (.asm)</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
</Files>
<PackName>ATmega_DFP</PackName>
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.7.374/Atmel.ATmega_DFP.pdsc</PackPath>
<PackVersion>1.7.374</PackVersion>
<PresentInProject>true</PresentInProject>
<ReferenceConditionId>ATmega2560</ReferenceConditionId>
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string></d4p1:string>
</RteComponents>
<Status>Resolved</Status>
<VersionMode>Fixed</VersionMode>
<IsComponentInAtProject>true</IsComponentInAtProject>
</ProjectComponent>
</ProjectComponents>
</Store>
Binary file not shown.
Loading