Skip to content

Add downloadable .hex files to releases (and pushes) #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
63135b0
Fix out-of-bounds bootAnimation check
albertonoys Mar 21, 2024
440fd1b
Merge remote-tracking branch 'albertonoys/fix-out-of-bounds-check'
wavexx Mar 24, 2024
eb529a4
vesc_uasrt: Fix compile error
jackrosenthal Mar 3, 2024
eeadc8b
able to build with gcc
fromeijn Oct 31, 2023
3af549b
make flash
fromeijn Oct 31, 2023
7587a99
Remove usage of floor
wavexx Mar 24, 2024
20b280d
Remove unused variables
wavexx Mar 24, 2024
520ccdf
Remove duplicate/incorrect public declarations
wavexx Mar 24, 2024
2e4e686
Fix gcc linker flags
wavexx Mar 24, 2024
6643f63
Mark implicit fall-thru
wavexx Mar 24, 2024
f6ca53d
No not use any stdlib on GCC
wavexx Mar 24, 2024
2cdaba0
Do not include stdio globally
wavexx Mar 24, 2024
55901f0
Reduce include pollution
wavexx Mar 24, 2024
b9e562b
Fix statusbar with gcc
wavexx Mar 24, 2024
0a53310
Try basic github actions build.
radimklaska Apr 28, 2024
338163a
Make file not found?
radimklaska Apr 28, 2024
cb61b08
Add gcc-arm-none-eabi.
radimklaska Apr 28, 2024
649b3b0
unrecognized option '--no-warn-rwx-segments'
radimklaska Apr 28, 2024
2b90b1e
Updated workflow to include release creation and asset upload
radimklaska Apr 28, 2024
2b4b00b
Upload files only if release is tagged.
radimklaska Apr 28, 2024
d0e195a
Build for both cell types.
radimklaska Apr 28, 2024
c674148
Create release only once.
radimklaska Apr 28, 2024
465510a
Create release only once.
radimklaska Apr 28, 2024
8eb9701
Create release only once.
radimklaska Apr 28, 2024
b23640c
Publish Artifacts for every build too.
radimklaska Apr 28, 2024
5660f96
Fix artifact path.
radimklaska Apr 28, 2024
a47e57f
Publish Artifacts fix.
radimklaska Apr 28, 2024
7222c60
Fix artifacts name.
radimklaska Apr 28, 2024
3af1a39
Merge branch 'main' into gcc_build
radimklaska Apr 28, 2024
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
89 changes: 89 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build LCM

on:
push:
branches:
- '*'
tags:
- 'v*' # This assumes that your version tags are prefixed with 'v'

jobs:
create_release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

build_release:
needs: create_release
runs-on: ubuntu-latest
strategy:
matrix:
cell_type: [P42A, DG40]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up GCC
uses: actions/setup-python@v2
with:
gcc-version: '11' # Specify the GCC version you need

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential gcc-arm-none-eabi

- name: Build project
run: |
cd LCM
make CELL_TYPE=${{ matrix.cell_type }}

- name: Release app.hex
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./LCM/Build/app.hex
asset_name: lcm-${{ matrix.cell_type }}.hex
asset_content_type: application/octet-stream

build_artifact:
runs-on: ubuntu-latest
strategy:
matrix:
cell_type: [P42A, DG40]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up GCC
uses: actions/setup-python@v2
with:
gcc-version: '11' # Specify the GCC version you need

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential gcc-arm-none-eabi

- name: Build project
run: |
cd LCM
make CELL_TYPE=${{ matrix.cell_type }}

- name: Publish Artifacts
uses: actions/upload-artifact@v2
with:
name: lcm-${{ matrix.cell_type }}.hex
path: ./LCM/Build/app.hex
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
LCM/Project/MDK5/Objects/
LCM/Project/MDK5/LCM_Light_Control_IO_WS2812_New.uvguix.*
LCM/Project/MDK5/Listings/
LCM/Build/
8 changes: 2 additions & 6 deletions LCM/Code/App/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ static void WS2812_Power_Display(uint8_t brightness)
**************************************************/
static void WS2812_VESC(void)
{
uint8_t i;
uint8_t pos, red;
uint8_t green = 0;
uint8_t blue = WS2812_Measure;
Expand Down Expand Up @@ -223,7 +222,7 @@ static void WS2812_VESC(void)
void WS2812_Boot(void)
{
uint8_t i;
uint8_t num = floor(Power_Time / 500) + 1;
uint8_t num = (Power_Time / 500) + 1;
uint8_t bootAnims[][10][3] = {
// Default (blue...green)
{{10,0,30}, {9,3,27}, {8,6,24}, {7,9,21}, {6,12,18}, {5,15,15}, {4,18,12}, {3,21,9}, {2,24,6}, {1,27,3}},
Expand Down Expand Up @@ -256,7 +255,7 @@ void WS2812_Boot(void)
void WS2812_Shutdown(void)
{
uint8_t brightness = 100;
int num = 10 - floor(Power_Time / 100);
int num = 10 - (Power_Time / 100);
if (num < 1) {
num = 1;
}
Expand Down Expand Up @@ -371,8 +370,6 @@ static void WS2812_Handtest(void)
**************************************************/
void WS2812_Task(void)
{
uint8_t i;

if(WS2812_Counter < 20) // 20ms refresh period
{
return;
Expand Down Expand Up @@ -704,7 +701,6 @@ static void Set_Headlights_Brightness(int brightness)
void Headlights_Task(void)
{
static uint8_t gear_position_last = 0;
static bool isForward = false;

if (Flashlight_Time < 10) {
return;
Expand Down
1 change: 1 addition & 0 deletions LCM/Code/App/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void Test_LED(void)
case 1:
led_pwm += 1;
pwm_st = 2;
/* FALLTHRU */
case 2:
led_pwm -= 500;
if(led_pwm == 0)
Expand Down
1 change: 1 addition & 0 deletions LCM/Code/App/vesc_uasrt.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "vesc_uasrt.h"
#include "flag_bit.h"
#include "eeprom.h"
#include <string.h>

uint8_t VESC_RX_Buff[256];
uint8_t VESC_RX_Flag = 0;
Expand Down
1 change: 0 additions & 1 deletion LCM/Code/App/vesc_uasrt.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef __VESC_USART_H
#define __VESC_USART_H

#include <string.h>
#include "hk32f030m.h"
#include "crc.h"
#include "usart.h"
Expand Down
4 changes: 3 additions & 1 deletion LCM/Code/App/ws2812.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ void WS2812_Left(void)

void delay(uint16_t i)
{
while(i--);
while(i--) {
__ASM volatile("nop");
}
}

void WS2812_Refresh(void)
Expand Down
35 changes: 13 additions & 22 deletions LCM/Code/Drive/io_ws2812.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,25 @@ void IO_WS2812_Init(void)
}
i=250 120us
*/

void WS2812_0_Code(void)
{
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4; //250ns

//250ns
for(int i = 0; i != 3; ++i) {
GPIOD->BSRR = GPIO_Pin_4;
__ASM volatile("" ::: "memory");
}

GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4; //750ns
}

void WS2812_1_Code(void)
{
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4;
GPIOD->BSRR = GPIO_Pin_4; //750ns

//750ns
for(int i = 0; i != 8; ++i) {
GPIOD->BSRR = GPIO_Pin_4;
__ASM volatile("" ::: "memory");
}

GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4;
// GPIOD->BRR = GPIO_Pin_4; //250ns
}
9 changes: 5 additions & 4 deletions LCM/Code/User/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@

//RCC_ClocksTypeDef RCC_Clock;

/*

*/
#ifdef __GNUC__
// stub init (main is called explicitly during startup)
void _init(void) {}
#endif

/**************************************************
* @brie :main()
* @note :������
* @param :��
* @retval :��
**************************************************/
int main(void)
void main(void)
{
//RCC_GetClocksFreq(&RCC_Clock);
LED_Init();
Expand Down
Loading