mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Merge pull request #157 from ledvinap/fix-whitespace
Fixed some whitespace around operators
This commit is contained in:
commit
dc3b90c5d0
9 changed files with 40 additions and 41 deletions
|
@ -39,7 +39,7 @@ rgbColor24bpp_t* hsvToRgb24(const hsvColor_t* c)
|
||||||
r.rgb.b = val;
|
r.rgb.b = val;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
base = ((255- sat) * val) >> 8;
|
base = ((255 - sat) * val) >> 8;
|
||||||
|
|
||||||
switch (hue / 60) {
|
switch (hue / 60) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -182,7 +182,7 @@ void i2c_OLED_clear_display(void)
|
||||||
i2c_OLED_send_cmd(0x40); // Display start line register to 0
|
i2c_OLED_send_cmd(0x40); // Display start line register to 0
|
||||||
i2c_OLED_send_cmd(0); // Set low col address to 0
|
i2c_OLED_send_cmd(0); // Set low col address to 0
|
||||||
i2c_OLED_send_cmd(0x10); // Set high col address to 0
|
i2c_OLED_send_cmd(0x10); // Set high col address to 0
|
||||||
for(uint16_t i=0; i<1024; i++) { // fill the display's RAM with graphic... 128*64 pixel picture
|
for(uint16_t i = 0; i < 1024; i++) { // fill the display's RAM with graphic... 128*64 pixel picture
|
||||||
i2c_OLED_send_byte(0x00); // clear
|
i2c_OLED_send_byte(0x00); // clear
|
||||||
}
|
}
|
||||||
i2c_OLED_send_cmd(0x81); // Setup CONTRAST CONTROL, following byte is the contrast Value... always a 2 byte instruction
|
i2c_OLED_send_cmd(0x81); // Setup CONTRAST CONTROL, following byte is the contrast Value... always a 2 byte instruction
|
||||||
|
@ -196,7 +196,7 @@ void i2c_OLED_clear_display_quick(void)
|
||||||
i2c_OLED_send_cmd(0x40); // Display start line register to 0
|
i2c_OLED_send_cmd(0x40); // Display start line register to 0
|
||||||
i2c_OLED_send_cmd(0); // Set low col address to 0
|
i2c_OLED_send_cmd(0); // Set low col address to 0
|
||||||
i2c_OLED_send_cmd(0x10); // Set high col address to 0
|
i2c_OLED_send_cmd(0x10); // Set high col address to 0
|
||||||
for(uint16_t i=0; i<1024; i++) { // fill the display's RAM with graphic... 128*64 pixel picture
|
for(uint16_t i = 0; i < 1024; i++) { // fill the display's RAM with graphic... 128*64 pixel picture
|
||||||
i2c_OLED_send_byte(0x00); // clear
|
i2c_OLED_send_byte(0x00); // clear
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ STATIC_UNIT_TESTED void fastUpdateLEDDMABuffer(rgbColor24bpp_t *color)
|
||||||
STATIC_UNIT_TESTED void updateLEDDMABuffer(uint8_t componentValue)
|
STATIC_UNIT_TESTED void updateLEDDMABuffer(uint8_t componentValue)
|
||||||
{
|
{
|
||||||
uint8_t bitIndex;
|
uint8_t bitIndex;
|
||||||
|
|
||||||
for (bitIndex = 0; bitIndex < 8; bitIndex++)
|
for (bitIndex = 0; bitIndex < 8; bitIndex++)
|
||||||
{
|
{
|
||||||
if ((componentValue << bitIndex) & 0x80 ) // data sent MSB first, j = 0 is MSB j = 7 is LSB
|
if ((componentValue << bitIndex) & 0x80 ) // data sent MSB first, j = 0 is MSB j = 7 is LSB
|
||||||
|
|
|
@ -57,7 +57,7 @@ void enableGPIOPowerUsageAndNoiseReductions(void)
|
||||||
|
|
||||||
gpio.mode = Mode_AIN;
|
gpio.mode = Mode_AIN;
|
||||||
|
|
||||||
gpio.pin = Pin_All & ~(Pin_13|Pin_14|Pin_15); // Leave JTAG pins alone
|
gpio.pin = Pin_All & ~(Pin_13 | Pin_14 | Pin_15); // Leave JTAG pins alone
|
||||||
gpioInit(GPIOA, &gpio);
|
gpioInit(GPIOA, &gpio);
|
||||||
|
|
||||||
gpio.pin = Pin_All;
|
gpio.pin = Pin_All;
|
||||||
|
|
|
@ -220,12 +220,12 @@ static void sortSerialPortFunctions(serialPortFunction_t *serialPortFunctions, u
|
||||||
|
|
||||||
int index1;
|
int index1;
|
||||||
int index2;
|
int index2;
|
||||||
|
|
||||||
// bubble-sort array (TODO - port selection can be implemented as repeated minimum search with bitmask marking used elements)
|
// bubble-sort array (TODO - port selection can be implemented as repeated minimum search with bitmask marking used elements)
|
||||||
for (index1 = 0; index1 < (elements - 1); index1++) {
|
for (index1 = 0; index1 < (elements - 1); index1++) {
|
||||||
for (index2 = 0; index2 < elements - index1 - 1; index2++) {
|
for (index2 = 0; index2 < elements - index1 - 1; index2++) {
|
||||||
if(serialPortFunctionMostSpecificFirstComparator(&serialPortFunctions[index2], &serialPortFunctions[index2 + 1]) > 0) {
|
if(serialPortFunctionMostSpecificFirstComparator(&serialPortFunctions[index2], &serialPortFunctions[index2 + 1]) > 0) {
|
||||||
swap=serialPortFunctions[index2];
|
swap = serialPortFunctions[index2];
|
||||||
serialPortFunctions[index2] = serialPortFunctions[index2 + 1];
|
serialPortFunctions[index2] = serialPortFunctions[index2 + 1];
|
||||||
serialPortFunctions[index2 + 1] = swap;
|
serialPortFunctions[index2 + 1] = swap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ bool isCalibrating()
|
||||||
void annexCode(void)
|
void annexCode(void)
|
||||||
{
|
{
|
||||||
int32_t tmp, tmp2;
|
int32_t tmp, tmp2;
|
||||||
int32_t axis, prop1, prop2;
|
int32_t axis, prop1 = 0, prop2;
|
||||||
|
|
||||||
static uint8_t batteryWarningEnabled = false;
|
static uint8_t batteryWarningEnabled = false;
|
||||||
static uint8_t vbatTimer = 0;
|
static uint8_t vbatTimer = 0;
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
* - Set the initial SP
|
* - Set the initial SP
|
||||||
* - Set the initial PC == Reset_Handler,
|
* - Set the initial PC == Reset_Handler,
|
||||||
* - Set the vector table entries with the exceptions ISR address
|
* - Set the vector table entries with the exceptions ISR address
|
||||||
* - Configure the clock system and the external SRAM mounted on
|
* - Configure the clock system and the external SRAM mounted on
|
||||||
* STM3230C-EVAL board to be used as data memory (optional,
|
* STM3230C-EVAL board to be used as data memory (optional,
|
||||||
* to be enabled by user)
|
* to be enabled by user)
|
||||||
* - Branches to main in the C library (which eventually
|
* - Branches to main in the C library (which eventually
|
||||||
* calls main()).
|
* calls main()).
|
||||||
|
@ -27,15 +27,15 @@
|
||||||
*
|
*
|
||||||
* http://www.st.com/software_license_agreement_liberty_v2
|
* http://www.st.com/software_license_agreement_liberty_v2
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
.cpu cortex-m4
|
.cpu cortex-m4
|
||||||
.fpu softvfp
|
.fpu softvfp
|
||||||
|
@ -44,10 +44,10 @@
|
||||||
.global g_pfnVectors
|
.global g_pfnVectors
|
||||||
.global Default_Handler
|
.global Default_Handler
|
||||||
|
|
||||||
/* start address for the initialization values of the .data section.
|
/* start address for the initialization values of the .data section.
|
||||||
defined in linker script */
|
defined in linker script */
|
||||||
.word _sidata
|
.word _sidata
|
||||||
/* start address for the .data section. defined in linker script */
|
/* start address for the .data section. defined in linker script */
|
||||||
.word _sdata
|
.word _sdata
|
||||||
/* end address for the .data section. defined in linker script */
|
/* end address for the .data section. defined in linker script */
|
||||||
.word _edata
|
.word _edata
|
||||||
|
@ -61,7 +61,7 @@ defined in linker script */
|
||||||
* @brief This is the code that gets called when the processor first
|
* @brief This is the code that gets called when the processor first
|
||||||
* starts execution following a reset event. Only the absolutely
|
* starts execution following a reset event. Only the absolutely
|
||||||
* necessary set is performed, after which the application
|
* necessary set is performed, after which the application
|
||||||
* supplied main() routine is called.
|
* supplied main() routine is called.
|
||||||
* @param None
|
* @param None
|
||||||
* @retval : None
|
* @retval : None
|
||||||
*/
|
*/
|
||||||
|
@ -69,9 +69,9 @@ defined in linker script */
|
||||||
.section .text.Reset_Handler
|
.section .text.Reset_Handler
|
||||||
.weak Reset_Handler
|
.weak Reset_Handler
|
||||||
.type Reset_Handler, %function
|
.type Reset_Handler, %function
|
||||||
Reset_Handler:
|
Reset_Handler:
|
||||||
|
|
||||||
/* Copy the data segment initializers from flash to SRAM */
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
movs r1, #0
|
movs r1, #0
|
||||||
b LoopCopyDataInit
|
b LoopCopyDataInit
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ CopyDataInit:
|
||||||
ldr r3, [r3, r1]
|
ldr r3, [r3, r1]
|
||||||
str r3, [r0, r1]
|
str r3, [r0, r1]
|
||||||
adds r1, r1, #4
|
adds r1, r1, #4
|
||||||
|
|
||||||
LoopCopyDataInit:
|
LoopCopyDataInit:
|
||||||
ldr r0, =_sdata
|
ldr r0, =_sdata
|
||||||
ldr r3, =_edata
|
ldr r3, =_edata
|
||||||
|
@ -89,11 +89,11 @@ LoopCopyDataInit:
|
||||||
bcc CopyDataInit
|
bcc CopyDataInit
|
||||||
ldr r2, =_sbss
|
ldr r2, =_sbss
|
||||||
b LoopFillZerobss
|
b LoopFillZerobss
|
||||||
/* Zero fill the bss segment. */
|
/* Zero fill the bss segment. */
|
||||||
FillZerobss:
|
FillZerobss:
|
||||||
movs r3, #0
|
movs r3, #0
|
||||||
str r3, [r2], #4
|
str r3, [r2], #4
|
||||||
|
|
||||||
LoopFillZerobss:
|
LoopFillZerobss:
|
||||||
ldr r3, = _ebss
|
ldr r3, = _ebss
|
||||||
cmp r2, r3
|
cmp r2, r3
|
||||||
|
@ -103,15 +103,15 @@ LoopFillZerobss:
|
||||||
bl SystemInit
|
bl SystemInit
|
||||||
/* Call the application's entry point.*/
|
/* Call the application's entry point.*/
|
||||||
bl main
|
bl main
|
||||||
bx lr
|
bx lr
|
||||||
.size Reset_Handler, .-Reset_Handler
|
.size Reset_Handler, .-Reset_Handler
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the code that gets called when the processor receives an
|
* @brief This is the code that gets called when the processor receives an
|
||||||
* unexpected interrupt. This simply enters an infinite loop, preserving
|
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||||
* the system state for examination by a debugger.
|
* the system state for examination by a debugger.
|
||||||
* @param None
|
* @param None
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
.section .text.Default_Handler,"ax",%progbits
|
.section .text.Default_Handler,"ax",%progbits
|
||||||
Default_Handler:
|
Default_Handler:
|
||||||
|
@ -123,13 +123,13 @@ Infinite_Loop:
|
||||||
* The minimal vector table for a Cortex M4. Note that the proper constructs
|
* The minimal vector table for a Cortex M4. Note that the proper constructs
|
||||||
* must be placed on this to ensure that it ends up at physical address
|
* must be placed on this to ensure that it ends up at physical address
|
||||||
* 0x0000.0000.
|
* 0x0000.0000.
|
||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
.section .isr_vector,"a",%progbits
|
.section .isr_vector,"a",%progbits
|
||||||
.type g_pfnVectors, %object
|
.type g_pfnVectors, %object
|
||||||
.size g_pfnVectors, .-g_pfnVectors
|
.size g_pfnVectors, .-g_pfnVectors
|
||||||
|
|
||||||
|
|
||||||
g_pfnVectors:
|
g_pfnVectors:
|
||||||
.word _estack
|
.word _estack
|
||||||
.word Reset_Handler
|
.word Reset_Handler
|
||||||
|
@ -440,26 +440,26 @@ g_pfnVectors:
|
||||||
.thumb_set DMA2_Channel5_IRQHandler,Default_Handler
|
.thumb_set DMA2_Channel5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
.weak ADC4_IRQHandler
|
.weak ADC4_IRQHandler
|
||||||
.thumb_set ADC4_IRQHandler,Default_Handler
|
.thumb_set ADC4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
.weak COMP1_2_3_IRQHandler
|
.weak COMP1_2_3_IRQHandler
|
||||||
.thumb_set COMP1_2_3_IRQHandler,Default_Handler
|
.thumb_set COMP1_2_3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
.weak COMP4_5_6_IRQHandler
|
.weak COMP4_5_6_IRQHandler
|
||||||
.thumb_set COMP4_5_6_IRQHandler,Default_Handler
|
.thumb_set COMP4_5_6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
.weak COMP7_IRQHandler
|
.weak COMP7_IRQHandler
|
||||||
.thumb_set COMP7_IRQHandler,Default_Handler
|
.thumb_set COMP7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
.weak USB_HP_IRQHandler
|
.weak USB_HP_IRQHandler
|
||||||
.thumb_set USB_HP_IRQHandler,Default_Handler
|
.thumb_set USB_HP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
.weak USB_LP_IRQHandler
|
.weak USB_LP_IRQHandler
|
||||||
.thumb_set USB_LP_IRQHandler,Default_Handler
|
.thumb_set USB_LP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
.weak USBWakeUp_RMP_IRQHandler
|
.weak USBWakeUp_RMP_IRQHandler
|
||||||
.thumb_set USBWakeUp_RMP_IRQHandler,Default_Handler
|
.thumb_set USBWakeUp_RMP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
.weak FPU_IRQHandler
|
.weak FPU_IRQHandler
|
||||||
.thumb_set FPU_IRQHandler,Default_Handler
|
.thumb_set FPU_IRQHandler,Default_Handler
|
||||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||||
|
|
|
@ -181,7 +181,7 @@ static void sendThrottleOrBatterySizeAsRpm(void)
|
||||||
if (ARMING_FLAG(ARMED)) {
|
if (ARMING_FLAG(ARMED)) {
|
||||||
serialize16(rcCommand[THROTTLE] / BLADE_NUMBER_DIVIDER);
|
serialize16(rcCommand[THROTTLE] / BLADE_NUMBER_DIVIDER);
|
||||||
} else {
|
} else {
|
||||||
serialize16((telemetryConfig->batterySize / BLADE_NUMBER_DIVIDER));
|
serialize16((telemetryConfig->batterySize / BLADE_NUMBER_DIVIDER));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ static void GPStoDDDMM_MMMM(int32_t mwiigps, gpsCoordinateDDDMMmmmm_t *result)
|
||||||
if (telemetryConfig->frsky_coordinate_format == FRSKY_FORMAT_DMS) {
|
if (telemetryConfig->frsky_coordinate_format == FRSKY_FORMAT_DMS) {
|
||||||
result->dddmm = deg * 100 + min;
|
result->dddmm = deg * 100 + min;
|
||||||
} else {
|
} else {
|
||||||
result->dddmm = deg * 60 + min;
|
result->dddmm = deg * 60 + min;
|
||||||
}
|
}
|
||||||
|
|
||||||
result->mmmm = (absgps - min * GPS_DEGREES_DIVIDER) / 1000;
|
result->mmmm = (absgps - min * GPS_DEGREES_DIVIDER) / 1000;
|
||||||
|
@ -274,7 +274,7 @@ static void sendGPS(void)
|
||||||
// Send dummy GPS Data in order to display compass value
|
// Send dummy GPS Data in order to display compass value
|
||||||
localGPS_coord[LAT] = (telemetryConfig->gpsNoFixLatitude * GPS_DEGREES_DIVIDER);
|
localGPS_coord[LAT] = (telemetryConfig->gpsNoFixLatitude * GPS_DEGREES_DIVIDER);
|
||||||
localGPS_coord[LON] = (telemetryConfig->gpsNoFixLongitude * GPS_DEGREES_DIVIDER);
|
localGPS_coord[LON] = (telemetryConfig->gpsNoFixLongitude * GPS_DEGREES_DIVIDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpsCoordinateDDDMMmmmm_t coordinate;
|
gpsCoordinateDDDMMmmmm_t coordinate;
|
||||||
GPStoDDDMM_MMMM(localGPS_coord[LAT], &coordinate);
|
GPStoDDDMM_MMMM(localGPS_coord[LAT], &coordinate);
|
||||||
|
|
|
@ -215,7 +215,6 @@ void USB_Interrupts_Config(void)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void USB_Cable_Config(FunctionalState NewState)
|
void USB_Cable_Config(FunctionalState NewState)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue