Skip to content

Commit 1cc0e41

Browse files
nfbotAdrianSoundy
authored andcommitted
Code style fixes
Automated fixes for code style.
1 parent 566019c commit 1cc0e41

File tree

7 files changed

+38
-32
lines changed

7 files changed

+38
-32
lines changed

targets/ESP32/_common/ESP32_C6_DeviceMapping.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ int8_t Esp32_SPI_DevicePinMap[MAX_SPI_DEVICES][Esp32SpiPin_Max] = {
2323
// others assign as NONE because the default pins can be shared with serial flash and PSRAM
2424
int8_t Esp32_SERIAL_DevicePinMap[UART_NUM_MAX][Esp32SerialPin_Max] = {
2525
// COM 1 - pins 21, 20
26-
{UART_NUM_0_TXD_DIRECT_GPIO_NUM,
27-
UART_NUM_0_RXD_DIRECT_GPIO_NUM,
28-
UART_PIN_NO_CHANGE,
29-
UART_PIN_NO_CHANGE},
26+
{UART_NUM_0_TXD_DIRECT_GPIO_NUM, UART_NUM_0_RXD_DIRECT_GPIO_NUM, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE},
3027

3128
#if defined(UART_NUM_2)
3229
// COM 2 - all set to UART_PIN_NO_CHANGE
@@ -60,9 +57,14 @@ int8_t Esp32_LED_DevicePinMap[6] = {
6057
// Mapped to ESP32_C6 controllers
6158
// ESP32 ADC1 channels 0 - 6
6259
int8_t Esp32_ADC_DevicePinMap[7] = {
63-
// 0 1 2 3 4 5
64-
0, 1, 2, 3, 4, 5, 6
65-
};
60+
// 0 1 2 3 4 5
61+
0,
62+
1,
63+
2,
64+
3,
65+
4,
66+
5,
67+
6};
6668

6769
// I2S
6870
// 1 device I2S1

targets/ESP32/_common/ESP32_H2_DeviceMapping.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ int8_t Esp32_SPI_DevicePinMap[MAX_SPI_DEVICES][Esp32SpiPin_Max] = {
2323
// others assign as NONE because the default pins can be shared with serial flash and PSRAM
2424
int8_t Esp32_SERIAL_DevicePinMap[UART_NUM_MAX][Esp32SerialPin_Max] = {
2525
// COM 1 - pins 21, 20
26-
{UART_NUM_0_TXD_DIRECT_GPIO_NUM,
27-
UART_NUM_0_RXD_DIRECT_GPIO_NUM,
28-
UART_PIN_NO_CHANGE,
29-
UART_PIN_NO_CHANGE},
26+
{UART_NUM_0_TXD_DIRECT_GPIO_NUM, UART_NUM_0_RXD_DIRECT_GPIO_NUM, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE},
3027

3128
#if defined(UART_NUM_2)
3229
// COM 2 - all set to UART_PIN_NO_CHANGE
@@ -56,14 +53,12 @@ int8_t Esp32_LED_DevicePinMap[TARGET_LED_NUM_PINS] = {
5653
-1, // 6
5754
-1, // 7
5855
-1, // 8
59-
};
56+
};
6057

6158
// We use "ADC1" for 5 logical channels
6259
// Mapped to ESP32_H2 controllers
6360
// ESP32_H2 ADC1 channels 1 - 5
64-
int8_t Esp32_ADC_DevicePinMap[TARGET_ADC_NUM_PINS] = {
65-
1, 2, 3, 4, 5
66-
};
61+
int8_t Esp32_ADC_DevicePinMap[TARGET_ADC_NUM_PINS] = {1, 2, 3, 4, 5};
6762

6863
// I2S
6964
// 1 device I2S1

targets/ESP32/_common/ESP32_P4_DeviceMapping.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ int8_t Esp32_SPI_DevicePinMap[MAX_SPI_DEVICES][Esp32SpiPin_Max] = {
2424
// others assign as NONE because the default pins can be shared with serial flash and PSRAM
2525
int8_t Esp32_SERIAL_DevicePinMap[UART_NUM_MAX][Esp32SerialPin_Max] = {
2626
// COM 1 - pins 21, 20
27-
{UART_NUM_0_TXD_DIRECT_GPIO_NUM,
28-
UART_NUM_0_RXD_DIRECT_GPIO_NUM,
29-
UART_PIN_NO_CHANGE,
30-
UART_PIN_NO_CHANGE},
27+
{UART_NUM_0_TXD_DIRECT_GPIO_NUM, UART_NUM_0_RXD_DIRECT_GPIO_NUM, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE},
3128

3229
#if defined(UART_NUM_2)
3330
// COM 2 - all set to UART_PIN_NO_CHANGE
@@ -66,10 +63,21 @@ int8_t Esp32_LED_DevicePinMap[8] = {
6663
// ADC2 channels 10 - 19
6764
int8_t Esp32_ADC_DevicePinMap[TARGET_ADC_NUM_PINS] = {
6865
// ADC1
69-
16,17,18,19,20,21,22,23
66+
16,
67+
17,
68+
18,
69+
19,
70+
20,
71+
21,
72+
22,
73+
23
7074
// ADC2
71-
49,50,51,52,53,54
72-
};
75+
49,
76+
50,
77+
51,
78+
52,
79+
53,
80+
54};
7381

7482
// I2S
7583
// 1 device I2S1

targets/ESP32/_include/esp32_idf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
#include <driver/ledc.h>
6565

6666
#if defined(CONFIG_IDF_TARGET_ESP32)
67-
// Use legacy ADC driver for ESP32 for now as the new one also requires the new I2S driver due to dependcy because of internal DAC
68-
// other ESP32 variants don't have DAC so use the new ADC driver
67+
// Use legacy ADC driver for ESP32 for now as the new one also requires the new I2S driver due to dependcy because of
68+
// internal DAC other ESP32 variants don't have DAC so use the new ADC driver
6969
#include <driver/adc.h>
7070
#else
7171
#include <esp_adc/adc_oneshot.h>

targets/ESP32/_nanoCLR/System.Device.Adc/sys_dev_adc_native_System_Device_Adc_AdcChannel.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ HRESULT Library_sys_dev_adc_native_System_Device_Adc_AdcChannel::NativeReadValue
3030
if (channelNumber < 0 || channelNumber > TARGET_ADC_NUM_PINS)
3131
{
3232
NANOCLR_SET_AND_LEAVE(CLR_E_INVALID_PARAMETER);
33-
}
33+
}
3434

3535
// Calculate internal ADC number based on channel number, 0->(CONFIG_SOC_ADC_MAX_CHANNEL_NUM - 1)
3636
adcNumber = channelNumber < CONFIG_SOC_ADC_MAX_CHANNEL_NUM ? ADC_UNIT_1 : ADC_UNIT_2;
@@ -41,18 +41,18 @@ HRESULT Library_sys_dev_adc_native_System_Device_Adc_AdcChannel::NativeReadValue
4141
{
4242
if (channelNumber == 8)
4343
{
44-
//reading = temperature_sens_read();
44+
// reading = temperature_sens_read();
4545
reading = 0;
4646
}
47-
else
47+
else
4848
{
4949
// Hall sensor no longer available
5050
NANOCLR_SET_AND_LEAVE(CLR_E_INVALID_PARAMETER);
5151
}
5252
}
5353
else
54-
#endif
55-
{
54+
#endif
55+
{
5656
if (adcNumber == ADC_UNIT_2)
5757
{
5858
// Adjust channel number for ADC2

targets/ESP32/_nanoCLR/System.Device.Adc/sys_dev_adc_native_System_Device_Adc_AdcChannel_legacy.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ HRESULT Library_sys_dev_adc_native_System_Device_Adc_AdcChannel::NativeReadValue
5454
{
5555
// Adjust channel number for ADC2
5656
channelNumber -= CONFIG_SOC_ADC_MAX_CHANNEL_NUM;
57-
esp_err_t result = adc2_get_raw((adc2_channel_t)channelNumber, (adc_bits_width_t)SOC_ADC_RTC_MAX_BITWIDTH, &reading);
57+
esp_err_t result =
58+
adc2_get_raw((adc2_channel_t)channelNumber, (adc_bits_width_t)SOC_ADC_RTC_MAX_BITWIDTH, &reading);
5859

5960
if (result != ESP_OK)
6061
{

targets/ESP32/_nanoCLR/System.Device.Adc/sys_dev_adc_native_System_Device_Adc_AdcController.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void AdcController_Initialize(adc_unit_t unit)
6262
{
6363
// already initialized
6464
return;
65-
}
65+
}
6666

6767
adc_oneshot_unit_init_cfg_t init_config1 = {};
6868
init_config1.unit_id = unit;
@@ -77,7 +77,7 @@ void AdcController_delete(adc_unit_t unit)
7777
{
7878
ESP_ERROR_CHECK(adc_oneshot_del_unit(adc_handles[unit]));
7979
adc_handles[unit] = NULL;
80-
}
80+
}
8181
}
8282

8383
HRESULT Library_sys_dev_adc_native_System_Device_Adc_AdcController::NativeOpenChannel___VOID__I4(

0 commit comments

Comments
 (0)