mirror of
https://github.com/jhbruhn/eurorack.git
synced 2025-03-15 11:05:49 +00:00
Fix build process to work, implement bootloader that does nothing
This commit is contained in:
parent
c728ed9a28
commit
09362032a1
4 changed files with 47 additions and 5 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
#include <stm32f10x_conf.h>
|
||||||
|
|
||||||
|
#include "stmlib/system/bootloader_utils.h"
|
||||||
|
|
||||||
|
using namespace stmlib;
|
||||||
|
|
||||||
|
const uint32_t kStartAddress = 0x08001000;
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
for(;;) ; //casual chillout
|
SystemInit();
|
||||||
|
Uninitialize();
|
||||||
|
JumpTo(kStartAddress);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,5 +17,5 @@ void GPIO::Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPIO::Write(GPIO_TypeDef* port, uint16_t pin, bool state) {
|
void GPIO::Write(GPIO_TypeDef* port, uint16_t pin, bool state) {
|
||||||
GPIO_WriteBit(GPIOB, pin, static_cast<BitAction>(state));
|
GPIO_WriteBit(port, pin, static_cast<BitAction>(state));
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ DENSITY = md
|
||||||
MEMORY_MODE = flash
|
MEMORY_MODE = flash
|
||||||
# USB = enabled
|
# USB = enabled
|
||||||
|
|
||||||
APPLICATION = TRUE
|
APPLICATION_SMALL = TRUE
|
||||||
BOOTLOADER = midi2cv_bootloader
|
BOOTLOADER = midi2cv_bootloader
|
||||||
|
|
||||||
# Preferred upload command
|
# Preferred upload command
|
||||||
|
|
|
@ -1,22 +1,54 @@
|
||||||
#include <stm32f10x_conf.h>
|
#include <stm32f10x_conf.h>
|
||||||
|
|
||||||
#include "stmlib/system/system_clock.h"
|
|
||||||
#include "drivers/gpio.h"
|
#include "drivers/gpio.h"
|
||||||
|
|
||||||
using namespace stmlib;
|
using namespace stmlib;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GPIO gpio;
|
GPIO gpio;
|
||||||
|
|
||||||
|
|
||||||
|
// Default interrupt handlers.
|
||||||
|
extern "C" {
|
||||||
|
void NMI_Handler() { }
|
||||||
|
void HardFault_Handler() {
|
||||||
|
while (1);
|
||||||
|
}
|
||||||
|
void MemManage_Handler() { while (1); }
|
||||||
|
void BusFault_Handler() { while (1); }
|
||||||
|
void UsageFault_Handler() { while (1); }
|
||||||
|
void SVC_Handler() { }
|
||||||
|
void DebugMon_Handler() { }
|
||||||
|
void PendSV_Handler() { }
|
||||||
|
|
||||||
|
// called every 1ms
|
||||||
|
void SysTick_Handler() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Init(void) {
|
void Init(void) {
|
||||||
//system_clock.Init();
|
SystemInit();
|
||||||
|
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x1000);
|
||||||
|
|
||||||
|
RCC_APB2PeriphClockCmd(
|
||||||
|
RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC |
|
||||||
|
RCC_APB2Periph_TIM1 | RCC_APB2Periph_USART1, ENABLE);
|
||||||
|
RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2, ENABLE);
|
||||||
|
|
||||||
gpio.Init();
|
gpio.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
Init();
|
Init();
|
||||||
|
while (1) {
|
||||||
// hi
|
// hi
|
||||||
gpio.Write(GPIO_PIN(GATE_OUT_1), 1);
|
gpio.Write(GPIO_PIN(GATE_OUT_1), 1);
|
||||||
gpio.Write(GPIO_PIN(GATE_OUT_2), 0);
|
gpio.Write(GPIO_PIN(GATE_OUT_2), 0);
|
||||||
gpio.Write(GPIO_PIN(GATE_OUT_3), 1);
|
gpio.Write(GPIO_PIN(GATE_OUT_3), 1);
|
||||||
gpio.Write(GPIO_PIN(GATE_OUT_4), 0);
|
gpio.Write(GPIO_PIN(GATE_OUT_4), 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue