Skip to content

Instantly share code, notes, and snippets.

View utzig's full-sized avatar

Fabio Utzig utzig

  • Brazil
View GitHub Profile
https://ler.amazon.com.br/?asin=B07944M286&ref_=pe_2740240_232748480
@utzig
utzig / hal_timer.c.diff
Created April 19, 2018 15:36
hal_timer.c.diff
diff --git a/hw/mcu/stm/stm32_common/src/hal_timer.c b/hw/mcu/stm/stm32_common/src/hal_timer.c
index bb7fcd9e3..2b493227d 100644
--- a/hw/mcu/stm/stm32_common/src/hal_timer.c
+++ b/hw/mcu/stm/stm32_common/src/hal_timer.c
@@ -595,13 +595,14 @@ hal_timer_cnt(struct stm32_hal_tmr *tmr)
int sr;
__HAL_DISABLE_INTERRUPTS(sr);
- cnt = tmr->sht_oflow + tmr->sht_regs->CNT;
if (tmr->sht_regs->SR & TIM_SR_UIF) {
@utzig
utzig / stm32-i2c.diff
Created March 21, 2018 16:04
I2C diff from STM32Cube
commit 689a232a22df3ad2772792f871e05bf0bd0521d3
Author: Marko Kiiskila <marko@runtime.io>
Date: Wed Oct 19 15:34:04 2016 -0700
stm32f4 SDK; add routines to write/read from i2c bus without sending
STOP in the end.
diff --git a/hw/mcu/stm/stm32f4xx/src/ext/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h b/hw/mcu/stm/stm32f4xx/src/ext/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h
index eb08c315d..863e14073 100644
--- a/hw/mcu/stm/stm32f4xx/src/ext/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h
@utzig
utzig / spitest-config-spinum.diff
Created March 21, 2018 10:47
Allow spitest to config SPI number to use
commit fa52a76de755097d038b9490106903e67e3e4c9c
Author: Fabio Utzig <utzig@apache.org>
Date: Fri Mar 2 08:27:43 2018 -0300
Add option do configure spi master/slave number
This adds new syscfg options to pass the number of the slave/master
peripheral to use in the tests. This customization is required when
testing on boards that have SPI0 pins already used for other purposes or
not easily reachable in the conn headers.
@utzig
utzig / dont_disable_tick.diff
Created March 21, 2018 09:52
Do not disable tick interrupt
diff --git a/hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h b/hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h
index 0b24798dc..7c0f41287 100644
index 0b24798dc..7c0f41287 100644
--- a/hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h
+++ b/hw/mcu/stm/stm32f3xx/include/mcu/stm32f3xx_mynewt_hal.h
@@ -27,21 +27,23 @@
extern "C" {
#endif
+/* PendSV has the highest prio, followed by SysTick */
@utzig
utzig / asl.md
Last active August 17, 2017 21:14
Lista de membros da ASL com filiacão partidária
@utzig
utzig / arch-linux-install
Created July 17, 2017 13:54 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
.journalbox{
border-style:solid inset;
border-width:6px;
border-color:#ccd9d8;
background-color:#080808;
color:#5fba3d;
font-family:monospace, prestige;
}
a{
@utzig
utzig / merge-pr.sh
Created February 20, 2017 19:39
Merge PR script
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <pr-number>"
exit 1
fi
pr=$1
repo="apache/incubator-mynewt-core"
info=$(curl -s "https://api.github.com/repos/${repo}/pulls/${pr}")
https://github.com/Zyg0te/call-blocker
https://github.com/prajwol/Simple-Call-Blocker
https://github.com/bhavyahmehta/CALL-SMS-Filter
https://github.com/prajwol/Simple-Call-Blocker