From 1f77b4b689add58576382425a33c5f171d1bad3b Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 19 Oct 2014 23:28:58 -0400 Subject: [PATCH] k20: Fix interrupt vector tables It's not clear where these came from but they certainly aren't what is listed in rev. 2 of the K20 reference manual. --- src/zinc/hal/k20/iomem.ld | 28 +------------ src/zinc/hal/k20/isr.rs | 83 +++------------------------------------ 2 files changed, 7 insertions(+), 104 deletions(-) diff --git a/src/zinc/hal/k20/iomem.ld b/src/zinc/hal/k20/iomem.ld index 85edf218..9423a772 100644 --- a/src/zinc/hal/k20/iomem.ld +++ b/src/zinc/hal/k20/iomem.ld @@ -4,18 +4,6 @@ PROVIDE(isr_dma_0 = isr_default_fault); PROVIDE(isr_dma_1 = isr_default_fault); PROVIDE(isr_dma_2 = isr_default_fault); PROVIDE(isr_dma_3 = isr_default_fault); -PROVIDE(isr_dma_4 = isr_default_fault); -PROVIDE(isr_dma_5 = isr_default_fault); -PROVIDE(isr_dma_6 = isr_default_fault); -PROVIDE(isr_dma_7 = isr_default_fault); -PROVIDE(isr_dma_8 = isr_default_fault); -PROVIDE(isr_dma_9 = isr_default_fault); -PROVIDE(isr_dma_10 = isr_default_fault); -PROVIDE(isr_dma_11 = isr_default_fault); -PROVIDE(isr_dma_12 = isr_default_fault); -PROVIDE(isr_dma_13 = isr_default_fault); -PROVIDE(isr_dma_14 = isr_default_fault); -PROVIDE(isr_dma_15 = isr_default_fault); PROVIDE(isr_dma_err = isr_default_fault); PROVIDE(isr_flash_complete = isr_default_fault); PROVIDE(isr_flash_collision = isr_default_fault); @@ -23,17 +11,9 @@ PROVIDE(isr_low_volt = isr_default_fault); PROVIDE(isr_llwu = isr_default_fault); PROVIDE(isr_wdt = isr_default_fault); PROVIDE(isr_i2c_0 = isr_default_fault); -PROVIDE(isr_i2c_1 = isr_default_fault); PROVIDE(isr_spi_0 = isr_default_fault); -PROVIDE(isr_spi_1 = isr_default_fault); -PROVIDE(isr_can_0_msg = isr_default_fault); -PROVIDE(isr_can_0_bus = isr_default_fault); -PROVIDE(isr_can_0_err = isr_default_fault); -PROVIDE(isr_can_0_tx = isr_default_fault); -PROVIDE(isr_can_0_rx = isr_default_fault); -PROVIDE(isr_can_0_wake = isr_default_fault); -PROVIDE(isr_i2s_0_tx = isr_default_fault); -PROVIDE(isr_i2s_0_rx = isr_default_fault); +PROVIDE(isr_i2s_0 = isr_default_fault); +PROVIDE(isr_i2s_1 = isr_default_fault); PROVIDE(isr_uart_0_lon = isr_default_fault); PROVIDE(isr_uart_0_stat = isr_default_fault); PROVIDE(isr_uart_0_err = isr_default_fault); @@ -42,13 +22,10 @@ PROVIDE(isr_uart_1_err = isr_default_fault); PROVIDE(isr_uart_2_stat = isr_default_fault); PROVIDE(isr_uart_2_err = isr_default_fault); PROVIDE(isr_adc_0 = isr_default_fault); -PROVIDE(isr_adc_1 = isr_default_fault); PROVIDE(isr_cmp_0 = isr_default_fault); PROVIDE(isr_cmp_1 = isr_default_fault); -PROVIDE(isr_cmp_2 = isr_default_fault); PROVIDE(isr_ftm_0 = isr_default_fault); PROVIDE(isr_ftm_1 = isr_default_fault); -PROVIDE(isr_ftm_2 = isr_default_fault); PROVIDE(ist_cmt = isr_default_fault); PROVIDE(isr_rtc_alarm = isr_default_fault); PROVIDE(isr_rtc_tick = isr_default_fault); @@ -59,7 +36,6 @@ PROVIDE(isr_pit_3 = isr_default_fault); PROVIDE(isr_pdb = isr_default_fault); PROVIDE(isr_usb = isr_default_fault); PROVIDE(isr_usb_dcd = isr_default_fault); -PROVIDE(isr_dac_0 = isr_default_fault); PROVIDE(isr_tsi = isr_default_fault); PROVIDE(isr_mcg = isr_default_fault); PROVIDE(isr_lptimer = isr_default_fault); diff --git a/src/zinc/hal/k20/isr.rs b/src/zinc/hal/k20/isr.rs index dc19d252..97af7ecb 100644 --- a/src/zinc/hal/k20/isr.rs +++ b/src/zinc/hal/k20/isr.rs @@ -21,18 +21,6 @@ extern { fn isr_dma_1(); fn isr_dma_2(); fn isr_dma_3(); - fn isr_dma_4(); - fn isr_dma_5(); - fn isr_dma_6(); - fn isr_dma_7(); - fn isr_dma_8(); - fn isr_dma_9(); - fn isr_dma_10(); - fn isr_dma_11(); - fn isr_dma_12(); - fn isr_dma_13(); - fn isr_dma_14(); - fn isr_dma_15(); fn isr_dma_err(); fn isr_flash_complete(); fn isr_flash_collision(); @@ -40,17 +28,9 @@ extern { fn isr_llwu(); fn isr_wdt(); fn isr_i2c_0(); - fn isr_i2c_1(); fn isr_spi_0(); - fn isr_spi_1(); - fn isr_can_0_msg(); - fn isr_can_0_bus(); - fn isr_can_0_err(); - fn isr_can_0_tx(); - fn isr_can_0_rx(); - fn isr_can_0_wake(); - fn isr_i2s_0_tx(); - fn isr_i2s_0_rx(); + fn isr_i2s_0(); + fn isr_i2s_1(); fn isr_uart_0_lon(); fn isr_uart_0_stat(); fn isr_uart_0_err(); @@ -59,13 +39,10 @@ extern { fn isr_uart_2_stat(); fn isr_uart_2_err(); fn isr_adc_0(); - fn isr_adc_1(); fn isr_cmp_0(); fn isr_cmp_1(); - fn isr_cmp_2(); fn isr_ftm_0(); fn isr_ftm_1(); - fn isr_ftm_2(); fn ist_cmt(); fn isr_rtc_alarm(); fn isr_rtc_tick(); @@ -76,7 +53,6 @@ extern { fn isr_pdb(); fn isr_usb(); fn isr_usb_dcd(); - fn isr_dac_0(); fn isr_tsi(); fn isr_mcg(); fn isr_lptimer(); @@ -89,7 +65,7 @@ extern { } #[allow(non_upper_case_globals)] -const ISRCount: uint = 95; +const ISRCount: uint = 46; #[link_section=".isr_vector_nvic"] #[allow(non_upper_case_globals)] @@ -99,18 +75,6 @@ pub static NVICVectors: [Option, ..ISRCount] = [ Some(isr_dma_1), Some(isr_dma_2), Some(isr_dma_3), - Some(isr_dma_4), - Some(isr_dma_5), - Some(isr_dma_6), - Some(isr_dma_7), - Some(isr_dma_8), - Some(isr_dma_9), - Some(isr_dma_10), - Some(isr_dma_11), - Some(isr_dma_12), - Some(isr_dma_13), - Some(isr_dma_14), - Some(isr_dma_15), Some(isr_dma_err), None, Some(isr_flash_complete), @@ -118,27 +82,10 @@ pub static NVICVectors: [Option, ..ISRCount] = [ Some(isr_low_volt), Some(isr_llwu), Some(isr_wdt), - None, Some(isr_i2c_0), - Some(isr_i2c_1), Some(isr_spi_0), - Some(isr_spi_1), - None, - Some(isr_can_0_msg), - Some(isr_can_0_bus), - Some(isr_can_0_err), - Some(isr_can_0_tx), - Some(isr_can_0_rx), - Some(isr_can_0_wake), - Some(isr_i2s_0_tx), - Some(isr_i2s_0_rx), - None, - None, - None, - None, - None, - None, - None, + Some(isr_i2s_0), + Some(isr_i2s_1), Some(isr_uart_0_lon), Some(isr_uart_0_stat), Some(isr_uart_0_err), @@ -146,20 +93,11 @@ pub static NVICVectors: [Option, ..ISRCount] = [ Some(isr_uart_1_err), Some(isr_uart_2_stat), Some(isr_uart_2_err), - None, - None, - None, - None, - None, - None, Some(isr_adc_0), - Some(isr_adc_1), Some(isr_cmp_0), Some(isr_cmp_1), - Some(isr_cmp_2), Some(isr_ftm_0), Some(isr_ftm_1), - Some(isr_ftm_2), Some(ist_cmt), Some(isr_rtc_alarm), Some(isr_rtc_tick), @@ -170,24 +108,13 @@ pub static NVICVectors: [Option, ..ISRCount] = [ Some(isr_pdb), Some(isr_usb), Some(isr_usb_dcd), - None, - None, - None, - None, - None, - None, - Some(isr_dac_0), - None, Some(isr_tsi), Some(isr_mcg), Some(isr_lptimer), - None, Some(isr_port_a), Some(isr_port_b), Some(isr_port_c), Some(isr_port_d), Some(isr_port_e), - None, - None, Some(isr_soft), ];