Skip to content

Instantly share code, notes, and snippets.

View xsrf's full-sized avatar

Andreas xsrf

View GitHub Profile
@xsrf
xsrf / CH32V003_TIM1_ISR_Debug_LEDs.c
Created August 26, 2024 15:59
CH32V003 TIM1 ISR Debug LEDs
#include "ch32v003fun.h"
#include <stdio.h>
// LEDs on A1 and A2 (to GND)
#define LED_PORT GPIOA
#define LED_PIN1 1
#define LED_PIN2 2
void TIM1_UP_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void TIM1_UP_IRQHandler(void) {
@xsrf
xsrf / CH32V003_TIM1_ISR_Debug.c
Last active August 26, 2024 20:19
CH32V003 TIM1 ISR Debug
#include "ch32v003fun.h"
#include <stdio.h>
// LEDs on A1 and A2 (to GND)
#define LED_PORT GPIOA
#define LED_PIN1 1
#define LED_PIN2 2
volatile unsigned int TIM1_UP_IRQHandler_INTFR = 0;
volatile unsigned int TIM1_CC_IRQHandler_INTFR = 0;
@xsrf
xsrf / CellBroadcast.md
Last active June 13, 2022 16:54
CellBroadcast

CellBroadcast / CMAS / EU-Alert / DE-Alert

CellBroadcast Channels defined in ETSI TS 123 041:

EU-Alert is specified in ETSI TS 102 900.

Android implements CMAS (and thus EU-Alert) since at least Android 4.2.2 and [dispatches them as special SMS messages](h

@xsrf
xsrf / easyeda_reset_netport_mark.js
Created March 14, 2021 12:35
EasyEDA Reset NetPort Mark alignment
// Reset NetPort Mark alignment (select Ports first)
api('getSelectedIds').split(',').forEach((k)=>{
netflag = api('getShape',{id: k});
if(netflag && netflag.mark && netflag.configure) {
netflag.mark.x = Number(netflag.configure.x) + (23 * (netflag.configure.rotation == 0 ? -1:1));
netflag.mark.y = Number(netflag.configure.y) + 3.5;
netflag.mark.textAnchor = (netflag.configure.rotation == 0) ? 'end' : 'start';
netflag.gId = netflag.configure.gId;
api('updateShape',{ shapeType:'netflag', "jsonCache": netflag });
}