diff --git a/Examples/template/dds/.clang-format b/Examples/template/dds/.clang-format index f8a98eb..73371c5 100644 --- a/Examples/template/dds/.clang-format +++ b/Examples/template/dds/.clang-format @@ -13,7 +13,7 @@ BraceWrapping: AfterStruct: true AfterUnion: true AfterExternBlock: true -ColumnLimit: 120 +ColumnLimit: 80 BreakBeforeBraces: Custom NamespaceIndentation: All TabWidth: 4 @@ -26,7 +26,7 @@ AllowShortLoopsOnASingleLine: true AllowShortIfStatementsOnASingleLine: true BinPackArguments: true BinPackParameters: true -BreakBeforeBinaryOperators: None +BreakBeforeBinaryOperators: All BreakBeforeTernaryOperators: false BreakAfterJavaFieldAnnotations: true AlignTrailingComments: true diff --git a/Examples/template/dds/src/init.c b/Examples/template/dds/src/init.c index 044db9e..0bc5e41 100644 --- a/Examples/template/dds/src/init.c +++ b/Examples/template/dds/src/init.c @@ -15,7 +15,6 @@ #include "isr.h" #include "main.h" - //============================================================================= // Constant Definition //============================================================================= @@ -46,7 +45,8 @@ void gpio_config() // PWM //-----------------// GPIO_InitTypeDef GPIO_InitStruct; - GPIO_InitStruct.GPIO_Pin = GPIO_Pin_00 | GPIO_Pin_01 | GPIO_Pin_02 | GPIO_Pin_03 | GPIO_Pin_04 | GPIO_Pin_05; + GPIO_InitStruct.GPIO_Pin = GPIO_Pin_00 | GPIO_Pin_01 | GPIO_Pin_02 + | GPIO_Pin_03 | GPIO_Pin_04 | GPIO_Pin_05; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStruct.GPIO_AF_Mode = GPIO_AF_6; GPIO_Init(GPIOA, &GPIO_InitStruct); @@ -137,7 +137,8 @@ void pwm_set_duty(uint16_t ch1_val, uint16_t ch2_val, uint16_t ch3_val) } void pwm_enable() { - REG_SET_BITS(EPWM->CCER, TIM_CCER_CC1E_Msk | TIM_CCER_CC1NE_Msk | TIM_CCER_CC2E_Msk | TIM_CCER_CC2NE_Msk | - TIM_CCER_CC3E_Msk | TIM_CCER_CC3NE_Msk); + REG_SET_BITS(EPWM->CCER, TIM_CCER_CC1E_Msk | TIM_CCER_CC1NE_Msk + | TIM_CCER_CC2E_Msk | TIM_CCER_CC2NE_Msk + | TIM_CCER_CC3E_Msk | TIM_CCER_CC3NE_Msk); return; } diff --git a/Examples/template/dds/src/isr.c b/Examples/template/dds/src/isr.c index bab0801..6ad61ed 100644 --- a/Examples/template/dds/src/isr.c +++ b/Examples/template/dds/src/isr.c @@ -13,7 +13,6 @@ #include "init.h" #include "main.h" - //============================================================================= // Constant Definition //============================================================================= diff --git a/Examples/template/dds/src/main.c b/Examples/template/dds/src/main.c index 1788539..5fafb41 100644 --- a/Examples/template/dds/src/main.c +++ b/Examples/template/dds/src/main.c @@ -30,12 +30,13 @@ //============================================================================= // Global Data Definition //============================================================================= -const uint16_t pwm_table[PWM_TABLE_SIZE] = { 1250, 1372, 1493, 1612, 1728, 1839, 1944, 2042, 2133, 2216, 2289, - 2352, 2404, 2446, 2475, 2493, 2499, 2493, 2475, 2446, 2404, 2352, - 2289, 2216, 2133, 2042, 1944, 1839, 1728, 1612, 1493, 1372, 1250, - 1127, 1006, 887, 771, 660, 555, 457, 366, 283, 210, 147, - 95, 53, 24, 6, 0, 6, 24, 53, 95, 147, 210, - 283, 366, 457, 555, 660, 771, 887, 1006, 1127 }; +const uint16_t pwm_table[PWM_TABLE_SIZE] + = { 1250, 1372, 1493, 1612, 1728, 1839, 1944, 2042, 2133, 2216, 2289, + 2352, 2404, 2446, 2475, 2493, 2499, 2493, 2475, 2446, 2404, 2352, + 2289, 2216, 2133, 2042, 1944, 1839, 1728, 1612, 1493, 1372, 1250, + 1127, 1006, 887, 771, 660, 555, 457, 366, 283, 210, 147, + 95, 53, 24, 6, 0, 6, 24, 53, 95, 147, 210, + 283, 366, 457, 555, 660, 771, 887, 1006, 1127 }; //============================================================================= // Private Function Definition //=============================================================================