style: code formatting

This commit is contained in:
Roy_01
2026-03-20 15:39:52 +08:00
parent 7aeffa6b70
commit 30711b45e3
4 changed files with 14 additions and 13 deletions
+2 -2
View File
@@ -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
+5 -4
View File
@@ -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;
}
-1
View File
@@ -13,7 +13,6 @@
#include "init.h"
#include "main.h"
//=============================================================================
// Constant Definition
//=============================================================================
+7 -6
View File
@@ -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
//=============================================================================