From e655fdf5b06bf3b8ca754dd0a6c7f37e87578259 Mon Sep 17 00:00:00 2001 From: Lucas Merritt Date: Fri, 26 Apr 2024 16:29:24 -0600 Subject: [PATCH] Build changes --- .github/workflows/act.yml | 11 +++++++++++ .github/workflows/build.yml | 2 +- Makefile | 5 ++++- src/hal/.hal.h.swp | Bin 0 -> 12288 bytes src/hal/hal.c | 4 ++-- src/hal/hal.h | 4 ++-- 6 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/act.yml create mode 100644 src/hal/.hal.h.swp diff --git a/.github/workflows/act.yml b/.github/workflows/act.yml new file mode 100644 index 0000000..0d5aa16 --- /dev/null +++ b/.github/workflows/act.yml @@ -0,0 +1,11 @@ +name: act-build + +jobs: + act-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: apt-get update + - run: apt install sudo + - run: sudo apt -y install gcc-arm-none-eabi make openocd git + - run: make diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f39dd82..aac916d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,5 +12,5 @@ jobs: steps: - uses: actions/checkout@v3 - run: sudo apt-get update - - run: sudo apt -y install gcc-arm-none-eabi make openocd + - run: sudo apt -y install gcc-arm-none-eabi make openocd git - run: make diff --git a/Makefile b/Makefile index cea9f6e..0196b0d 100644 --- a/Makefile +++ b/Makefile @@ -79,4 +79,7 @@ debug: @openocd -f interface/stlink.cfg -f board/stm32f0discovery.cfg -c "init" & @arm-none-eabi-gdb bin/firmware.elf -x gdbconf -.PHONY: all dep cmsis_core cmsis_f0 build clean dep_clean flash debug +test: + @act --job act-linux + +.PHONY: all dep cmsis_core cmsis_f0 build clean dep_clean flash debug test diff --git a/src/hal/.hal.h.swp b/src/hal/.hal.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..885ee02f7a6d64265e469877639f7523b19f7a38 GIT binary patch literal 12288 zcmeI2&u<$=6vwBa0s+d8_5dgJ+ED5ZZu}#GrfFK_I&Nd(I3acr5<;uBcN|Z%-d%QQ ziCunF{1EU5AkJJlaO4gW2M*=HjRO^&5q|&|B)&6i$9DSj&;y`Z>8tg;dGqGI&&eJ>-8 zk0D?P7y^cXAz%m?0)~JgUF2-*q0E8Txbn?2s#Y?aD=e|bP0MEdItLIamK!ZK7u}kcA)dn3UnCy z`7y@6hOR=ZP#HQ75p?5G#(ssqg38b_=qU6w^yds?KS9@_1iB2JgdT)`N4>v6-$UO) zpFy8Oio+uGBbb=W5HJJ`0YktL__q_7<-RLAc<1&dk9>M35H8um7c!$hTIYyzbF}Gk zC*~x(oIK(0@`ze6$a$K}O^<90V##~e@$jkc`#9Hq426R4oHkY7XjT{P!b^5_>$Nq< zcRe0utaDSyluOZGxQj>LE*$Ux+>+1=z0l+7Zt5U_9m;4l@d19?KNNoIoCseQUbZE{k|otzLL(9}{`xs?hmi;(AqQEy zeenGr>|1WDR{Z8d@vRh+LZ~)0*8y~SQ#>#)Nzvnx&HJHI*QM+%SYDztZOOYn^+U9bhCHt+i_+xJWvPD%RfEZf%D)2@{oP1TWA zBc_IA()|GrYKDF0m_v0~bec|;PFb|Ff|2wdO*p6_mfA_9CoNN?)+QkMiHov!A5_lIhb6$f&SgQ|h?BvfB`z_Tm?pcYYi-TsqdtslzTB&BQ!K32?38gKj zmH>HU@3kWls`G1krt3uRo=VAS#WHgAp^Y=H6*AHBENR = (RCC->AHBENR & ~BIT(n)) | (mode << n); /* Clear, then set bit. */ + RCC->AHBENR = (RCC->AHBENR & ~BIT(n)) | (uint32_t)(mode << n); /* Clear, then set bit. */ } int timer_expired(uint32_t *t, uint32_t prd, uint32_t now) @@ -71,7 +71,7 @@ void exti_pin_init(uint16_t pin, uint8_t rising, uint8_t priority, func_ptr hand volatile uint32_t *edge_selection = (&EXTI->FTSR - rising); /* Rising/falling edge. */ *edge_selection |= BIT(n); - SYSCFG->EXTICR[n / 4] |= PIN_BANK(pin) << ((n - (4 * (n / 4))) * 4); /* Set source input for respective EXTI line. */ + SYSCFG->EXTICR[n / 4] |= (uint32_t)(PIN_BANK(pin) << ((n - (4 * (n / 4))) * 4)); /* Set source input for respective EXTI line. */ uint8_t irq_pos = n < 2 ? EXTI0_1_IRQn : n < 4 ? EXTI2_3_IRQn : EXTI4_15_IRQn; NVIC_EnableIRQ(irq_pos); diff --git a/src/hal/hal.h b/src/hal/hal.h index 98ee7ce..5c7efbc 100644 --- a/src/hal/hal.h +++ b/src/hal/hal.h @@ -21,8 +21,8 @@ #define BIT_LAST(x, y) (x & ((1UL << y) - 1)) /* Last y bits. */ /* uint16_t(2 bytes): upper byte = bank #, lower byte = pin # */ -#define PIN(bank, num) ((((bank) - 'A') << 8) | (num)) /* ex: PIN('C', 7) */ -#define PIN_NUM(pin) ((uint8_t)BIT_LAST(pin, 8)) +#define PIN(bank, num) (((uint16_t)((bank) - 'A') << 8) | (uint16_t)(num)) +#define PIN_NUM(pin) ((uint8_t)(BIT_LAST(pin, 8))) #define PIN_BANK(pin) ((uint8_t)((pin) >> 8)) /* GPIO input/output modes. */