Skip to content

Commit

Permalink
Fixed hardfault (#342)
Browse files Browse the repository at this point in the history
* Fixed hardfault

* Formatting

* Formatting
  • Loading branch information
Akashem06 authored Nov 4, 2024
1 parent 2eb8e20 commit 537f682
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
5 changes: 1 addition & 4 deletions libraries/ms-common/inc/arm/uart_mcu.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#pragma once

#define NUM_UART_PORTS 3

typedef enum {
UART_PORT_1 = 0,
UART_PORT_2,
UART_PORT_3,
UART_PORT_4,
NUM_UART_PORTS,
} UartPort;
2 changes: 1 addition & 1 deletion libraries/ms-common/inc/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Module is not thread safe - do not access a single port from
// two locations at the same time

#define UART_MAX_BUFFER_LEN 512
#define UART_MAX_BUFFER_LEN 256

typedef struct {
GpioAddress tx; // tx pin
Expand Down
2 changes: 0 additions & 2 deletions libraries/ms-common/inc/x86/uart_mcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
typedef enum {
UART_PORT_1 = 0,
UART_PORT_2,
UART_PORT_3,
UART_PORT_4,
NUM_UART_PORTS,
} UartPort;
9 changes: 0 additions & 9 deletions libraries/ms-common/src/arm/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ static UartPortData s_port[] = {
.periph = RCC_APB1Periph_USART2,
.irq = USART2_IRQn,
.base = USART2 },
[UART_PORT_3] = { .rcc_cmd = RCC_APB1PeriphClockCmd,
.periph = RCC_APB1Periph_USART3,
.irq = USART3_IRQn,
.base = USART3 },
};

static void prv_handle_irq(UartPort uart);
Expand Down Expand Up @@ -169,8 +165,3 @@ void USART1_IRQHandler(void) {
void USART2_IRQHandler(void) {
prv_handle_irq(UART_PORT_2);
}

void USART3_4_IRQHandler(void) {
prv_handle_irq(UART_PORT_3);
prv_handle_irq(UART_PORT_4);
}

0 comments on commit 537f682

Please sign in to comment.