Skip to content

Commit

Permalink
config: add device.x file to define default handlers
Browse files Browse the repository at this point in the history
Adds default interrupt handler symbols in `device.x` file. Enables
weakly defined symbols that default to `DefaultHandler` implementations.
Handlers can be redefined, as in `examples/interrupt.rs`.
  • Loading branch information
rmsyn committed May 26, 2023
1 parent 4526999 commit d0c1157
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
runner = 'riscv64-unknown-elf-gdb -x openocd.gdb'
rustflags = [
"-C", "link-arg=-Tmemory-c8.x",
"-C", "link-arg=-Tdevice.x",
"-C", "link-arg=-Tlink.x",
]

Expand Down
64 changes: 64 additions & 0 deletions device.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
PROVIDE(INT_SFT = DefaultHandler);
PROVIDE(INT_TMR = DefaultHandler);
PROVIDE(INT_BWEI = DefaultHandler);
PROVIDE(INT_PMOVI = DefaultHandler);
PROVIDE(WWDGT = DefaultHandler);
PROVIDE(EXTI_LVD = DefaultHandler);
PROVIDE(TAMPER = DefaultHandler);
PROVIDE(RTC = DefaultHandler);
PROVIDE(FMC = DefaultHandler);
PROVIDE(RCU = DefaultHandler);
PROVIDE(EXTI_LINE0 = DefaultHandler);
PROVIDE(EXTI_LINE1 = DefaultHandler);
PROVIDE(EXTI_LINE2 = DefaultHandler);
PROVIDE(EXTI_LINE3 = DefaultHandler);
PROVIDE(EXTI_LINE4 = DefaultHandler);
PROVIDE(DMA0_CHANNEL0 = DefaultHandler);
PROVIDE(DMA0_CHANNEL1 = DefaultHandler);
PROVIDE(DMA0_CHANNEL2 = DefaultHandler);
PROVIDE(DMA0_CHANNEL3 = DefaultHandler);
PROVIDE(DMA0_CHANNEL4 = DefaultHandler);
PROVIDE(DMA0_CHANNEL5 = DefaultHandler);
PROVIDE(DMA0_CHANNEL6 = DefaultHandler);
PROVIDE(ADC0_1 = DefaultHandler);
PROVIDE(CAN0_TX = DefaultHandler);
PROVIDE(CAN0_RX0 = DefaultHandler);
PROVIDE(CAN0_RX1 = DefaultHandler);
PROVIDE(CAN0_EWMC = DefaultHandler);
PROVIDE(EXTI_LINE9_5 = DefaultHandler);
PROVIDE(TIMER0_BRK = DefaultHandler);
PROVIDE(TIMER0_UP = DefaultHandler);
PROVIDE(TIMER0_TRG_CMT = DefaultHandler);
PROVIDE(TIMER0_CHANNEL = DefaultHandler);
PROVIDE(TIMER1 = DefaultHandler);
PROVIDE(TIMER2 = DefaultHandler);
PROVIDE(TIMER3 = DefaultHandler);
PROVIDE(I2C0_EV = DefaultHandler);
PROVIDE(I2C0_ER = DefaultHandler);
PROVIDE(I2C1_EV = DefaultHandler);
PROVIDE(I2C1_ER = DefaultHandler);
PROVIDE(SPI0 = DefaultHandler);
PROVIDE(SPI1 = DefaultHandler);
PROVIDE(USART0 = DefaultHandler);
PROVIDE(USART1 = DefaultHandler);
PROVIDE(USART2 = DefaultHandler);
PROVIDE(EXTI_LINE15_10 = DefaultHandler);
PROVIDE(RTC_ALARM = DefaultHandler);
PROVIDE(USBFS_WKUP = DefaultHandler);
PROVIDE(TIMER4 = DefaultHandler);
PROVIDE(SPI2 = DefaultHandler);
PROVIDE(UART3 = DefaultHandler);
PROVIDE(UART4 = DefaultHandler);
PROVIDE(TIMER5 = DefaultHandler);
PROVIDE(TIMER6 = DefaultHandler);
PROVIDE(DMA1_CHANNEL0 = DefaultHandler);
PROVIDE(DMA1_CHANNEL1 = DefaultHandler);
PROVIDE(DMA1_CHANNEL2 = DefaultHandler);
PROVIDE(DMA1_CHANNEL3 = DefaultHandler);
PROVIDE(DMA1_CHANNEL4 = DefaultHandler);
PROVIDE(CAN1_TX = DefaultHandler);
PROVIDE(CAN1_RX0 = DefaultHandler);
PROVIDE(CAN1_RX1 = DefaultHandler);
PROVIDE(CAN1_EWMC = DefaultHandler);
PROVIDE(USBFS = DefaultHandler);

0 comments on commit d0c1157

Please sign in to comment.