From 22c960abcaf90c1140bc437d4f0f8d605763fbea Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Fri, 29 May 2026 09:45:34 +0200 Subject: [PATCH] bsp/arm/tms570: Apply RTEMS clang-format to bspreset.c Apply RTEMS preferred formatting as part of ESM bug fix. Formatting makes future maintenance easier. --- bsps/arm/tms570/start/bspreset.c | 48 ++++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/bsps/arm/tms570/start/bspreset.c b/bsps/arm/tms570/start/bspreset.c index 88b6da6d28..af8508a49c 100644 --- a/bsps/arm/tms570/start/bspreset.c +++ b/bsps/arm/tms570/start/bspreset.c @@ -43,41 +43,41 @@ #include #include -static void handle_esm_errors(uint32_t esm_irq_channel) +static void handle_esm_errors( uint32_t esm_irq_channel ) { - /* ESMR3 errors don't generate interrupts. */ - if (esm_irq_channel < 0x20u) { - TMS570_ESM.SR[0] = 1 << esm_irq_channel; - } else if (esm_irq_channel < 0x40u) { - TMS570_ESM.SR[1] = 1 << (esm_irq_channel - 32u); - } else if (esm_irq_channel < 0x60u) { - TMS570_ESM.SR4 = 1 << (esm_irq_channel - 64u); - } + /* ESMR3 errors don't generate interrupts. */ + if ( esm_irq_channel < 0x20u ) { + TMS570_ESM.SR[ 0 ] = 1 << esm_irq_channel; + } else if ( esm_irq_channel < 0x40u ) { + TMS570_ESM.SR[ 1 ] = 1 << ( esm_irq_channel - 32u ); + } else if ( esm_irq_channel < 0x60u ) { + TMS570_ESM.SR4 = 1 << ( esm_irq_channel - 64u ); + } } void bsp_reset( rtems_fatal_source source, rtems_fatal_code code ) { - rtems_interrupt_level level; - uint32_t esm_irq_offset; - uint32_t esm_irq_channel; + rtems_interrupt_level level; + uint32_t esm_irq_offset; + uint32_t esm_irq_channel; - (void) source; - (void) code; + (void) source; + (void) code; - rtems_interrupt_disable(level); - (void) level; + rtems_interrupt_disable( level ); + (void) level; - tms570_pom_initialize_and_clear(); + tms570_pom_initialize_and_clear(); - esm_irq_offset = TMS570_ESM.IOFFHR; + esm_irq_offset = TMS570_ESM.IOFFHR; - if (esm_irq_offset != 0U) { + if ( esm_irq_offset != 0U ) { esm_irq_channel = esm_irq_offset - 1U; - handle_esm_errors(esm_irq_channel); + handle_esm_errors( esm_irq_channel ); } - /* Reset the board */ - /* write of value other than 1 cause system reset */ - TMS570_SYS1.SYSECR = TMS570_SYS1_SYSECR_RESET(2); - RTEMS_UNREACHABLE(); + /* Reset the board */ + /* write of value other than 1 cause system reset */ + TMS570_SYS1.SYSECR = TMS570_SYS1_SYSECR_RESET( 2 ); + RTEMS_UNREACHABLE(); }