From 8cc05c79cea62609d02231492c054a0cca2b2289 Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 25 Sep 2023 23:57:36 +0200 Subject: Center firmware WIP --- center_fw/main.c | 73 -------------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 center_fw/main.c (limited to 'center_fw/main.c') diff --git a/center_fw/main.c b/center_fw/main.c deleted file mode 100644 index 3008dd2..0000000 --- a/center_fw/main.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Megumin LED display firmware - * Copyright (C) 2018 Sebastian Götte - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "global.h" - -int main(void) { - //RCC->CR |= RCC_CR_HSEON; - //while (!(RCC->CR&RCC_CR_HSERDY)); - RCC->CFGR &= ~RCC_CFGR_PLLMUL_Msk & ~RCC_CFGR_SW_Msk & ~RCC_CFGR_PPRE_Msk & ~RCC_CFGR_HPRE_Msk; - RCC->CFGR |= ((12-2)< 48.0MHz */ - RCC->CR |= RCC_CR_PLLON; - while (!(RCC->CR&RCC_CR_PLLRDY)); - RCC->CFGR |= (2<AHBENR |= RCC_AHBENR_GPIOAEN; - - GPIOA->MODER |= - (1< 5000) { - cnt = 0; - ph += 1; - ph %= 4; - } else { - cnt = cnt+1; - } - switch (ph) { - case 0: GPIOA->ODR = 1; break; - case 1: GPIOA->ODR = 3; break; - case 2: GPIOA->ODR = 2; break; - case 3: GPIOA->ODR = 0; break; - } - } -} - -void NMI_Handler(void) { - asm volatile ("bkpt"); -} - -void HardFault_Handler(void) __attribute__((naked)); -void HardFault_Handler() { - asm volatile ("bkpt"); -} - -void SVC_Handler(void) { - asm volatile ("bkpt"); -} - - -void PendSV_Handler(void) { - asm volatile ("bkpt"); -} - -- cgit