Skip to content

Commit 1113dd0

Browse files
committed
Fixed static functions with names conflicting with global functions.
1 parent e07d9ee commit 1113dd0

14 files changed

+56
-55
lines changed

source/board/mkit_dk_dongle_nrf5x.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* See the License for the specific language governing permissions and
1919
* limitations under the License.
2020
*/
21-
21+
2222
#include "sam3u2c.h"
2323
#include "DAP_config.h"
2424
#include "target_config.h"
@@ -37,6 +37,7 @@ const char *board_id_nrf52840_dk = "1102";
3737
extern target_cfg_t target_device_nrf52;
3838
extern target_cfg_t target_device_nrf52840;
3939
static uint8_t device_type;
40+
4041
static void set_target_device(uint32_t device)
4142
{
4243
device_type = device;
@@ -52,27 +53,27 @@ static void set_target_device(uint32_t device)
5253
}
5354

5455

55-
static void prerun_board_config(void)
56+
static void nrf_prerun_board_config(void)
5657
{
5758
// Work around for setting the correct board id based on GPIOs
5859
uint8_t bit1;
5960
uint8_t bit2;
6061
uint8_t bit3;
61-
62+
6263
PIOB->PIO_PER = (1 << 1); // Enable PIO pin PB1
6364
PIOB->PIO_PER = (1 << 2); // Enable PIO pin PB2
6465
PIOB->PIO_PER = (1 << 3); // Enable PIO pin PB3
6566
PIOB->PIO_ODR = (1 << 1); // Disabe output
6667
PIOB->PIO_ODR = (1 << 2); // Disabe output
6768
PIOB->PIO_ODR = (1 << 3); // Disabe output
68-
PIOB->PIO_PUER = (1 << 1); // Enable pull-up
69+
PIOB->PIO_PUER = (1 << 1); // Enable pull-up
6970
PIOB->PIO_PUER = (1 << 2); // Enable pull-up
7071
PIOB->PIO_PUER = (1 << 3); // Enable pull-up
71-
72+
7273
bit1 = (PIOB->PIO_PDSR >> 1) & 1; // Read PB1
7374
bit2 = (PIOB->PIO_PDSR >> 2) & 1; // Read PB2
7475
bit3 = (PIOB->PIO_PDSR >> 3) & 1; // Read PB3
75-
76+
7677
/* pins translate to board-ids as follow
7778
*
7879
* PB3|PB2|PB1|BOARD ID| BOARD
@@ -87,7 +88,7 @@ static void prerun_board_config(void)
8788
* 1 | 1 | 0 | undefined
8889
*/
8990

90-
91+
9192
if (bit3) {
9293
set_target_device(0);
9394
target_device.rt_family_id = kNordic_Nrf51_FamilyID;
@@ -115,13 +116,13 @@ static void prerun_board_config(void)
115116
target_device.rt_board_id = board_id_nrf52840_dk; // 1102
116117
}
117118
}
118-
119-
PIOB->PIO_PUDR = (1 << 1); // Disable pull-up
119+
120+
PIOB->PIO_PUDR = (1 << 1); // Disable pull-up
120121
PIOB->PIO_PUDR = (1 << 2); // Disable pull-up
121122
PIOB->PIO_PUDR = (1 << 3); // Disable pull-up
122123
}
123124

124-
static void swd_set_target_reset(uint8_t asserted){
125+
static void nrf_swd_set_target_reset(uint8_t asserted){
125126
if (asserted && device_type == 0) {
126127
PIOA->PIO_OER = PIN_SWDIO;
127128
PIOA->PIO_OER = PIN_SWCLK;
@@ -133,7 +134,7 @@ static void swd_set_target_reset(uint8_t asserted){
133134
const board_info_t g_board_info = {
134135
.infoVersion = 0x0,
135136
.flags = kEnablePageErase,
136-
.prerun_board_config = prerun_board_config,
137-
.swd_set_target_reset = swd_set_target_reset,
137+
.prerun_board_config = nrf_prerun_board_config,
138+
.swd_set_target_reset = nrf_swd_set_target_reset,
138139
.target_cfg = &target_device,
139140
};

source/board/ublox_evk_nina_b1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "target_board.h"
2424
#include "target_family.h"
2525

26-
static void swd_set_target_reset(uint8_t asserted){
26+
static void nina_swd_set_target_reset(uint8_t asserted){
2727
if(!asserted) {
2828
PIOA->PIO_MDER = PIN_SWDIO | PIN_SWCLK | PIN_nRESET;
2929
}
@@ -33,6 +33,6 @@ const board_info_t g_board_info = {
3333
.infoVersion = 0x0,
3434
.board_id = "1237",
3535
.family_id = kNordic_Nrf52_FamilyID,
36-
.swd_set_target_reset = swd_set_target_reset,
36+
.swd_set_target_reset = nina_swd_set_target_reset,
3737
.target_cfg = &target_device,
3838
};

source/board/vbluno51.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "target_board.h"
2424
#include "target_family.h"
2525

26-
static void prerun_board_config()
26+
static void vbluno_prerun_board_config()
2727
{
2828
uart_enable_flow_control(false);
2929
}
@@ -33,6 +33,6 @@ const board_info_t g_board_info = {
3333
.board_id = "C006",
3434
.family_id = kNordic_Nrf51_FamilyID,
3535
.daplink_target_url = "https://os.mbed.com/platforms/VBLUNO51/",
36-
.prerun_board_config = prerun_board_config,
36+
.prerun_board_config = vbluno_prerun_board_config,
3737
.target_cfg = &target_device,
3838
};

source/family/arm/musca_a/target_reset.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "power_ctrl.h"
3131
#include "uart.h"
3232

33-
static void target_before_init_debug(void)
33+
static void musca_a_target_before_init_debug(void)
3434
{
3535
uint8_t buf[12];
3636

@@ -103,7 +103,7 @@ static void target_before_init_debug(void)
103103
return;
104104
}
105105

106-
static uint8_t target_set_state(TARGET_RESET_STATE state)
106+
static uint8_t musca_a_target_set_state(TARGET_RESET_STATE state)
107107
{
108108
if(state == RESET_RUN)
109109
{
@@ -156,8 +156,8 @@ static uint8_t target_set_state(TARGET_RESET_STATE state)
156156
}
157157

158158
const target_family_descriptor_t g_target_family_musca_a = {
159-
.target_before_init_debug = target_before_init_debug,
160-
.target_set_state = target_set_state,
159+
.target_before_init_debug = musca_a_target_before_init_debug,
160+
.target_set_state = musca_a_target_set_state,
161161
.apsel = 0x01000000,
162162
};
163163

source/family/arm/musca_b/target_reset.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "power_ctrl.h"
3232
#include "uart.h"
3333

34-
static void target_before_init_debug(void)
34+
static void musca_b_target_before_init_debug(void)
3535
{
3636
uint8_t buf[12];
3737

@@ -108,7 +108,7 @@ static void target_before_init_debug(void)
108108
return;
109109
}
110110

111-
static uint8_t target_set_state(TARGET_RESET_STATE state)
111+
static uint8_t musca_b_target_set_state(TARGET_RESET_STATE state)
112112
{
113113
if(state == RESET_RUN)
114114
{
@@ -161,8 +161,8 @@ static uint8_t target_set_state(TARGET_RESET_STATE state)
161161
}
162162

163163
const target_family_descriptor_t g_target_family_musca_b = {
164-
.target_before_init_debug = target_before_init_debug,
165-
.target_set_state = target_set_state,
164+
.target_before_init_debug = musca_b_target_before_init_debug,
165+
.target_set_state = musca_b_target_set_state,
166166
.apsel = 0x01000000,
167167
};
168168

source/family/nordic/target_reset_nrf51.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "target_family.h"
2626
#include "target_board.h"
2727

28-
static void swd_set_target_reset(uint8_t asserted)
28+
static void swd_set_target_reset_nrf(uint8_t asserted)
2929
{
3030
if (asserted) {
3131
swd_init_debug();
@@ -59,5 +59,5 @@ const target_family_descriptor_t g_nordic_nrf51 = {
5959
.family_id = kNordic_Nrf51_FamilyID,
6060
.default_reset_type = kSoftwareReset,
6161
.soft_reset_type = SYSRESETREQ,
62-
.swd_set_target_reset = swd_set_target_reset,
62+
.swd_set_target_reset = swd_set_target_reset_nrf,
6363
};

source/family/nordic/target_reset_nrf52.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "target_family.h"
2626
#include "target_board.h"
2727

28-
static void swd_set_target_reset(uint8_t asserted)
28+
static void swd_set_target_reset_nrf(uint8_t asserted)
2929
{
3030
uint32_t ap_index_return;
3131

@@ -65,5 +65,5 @@ const target_family_descriptor_t g_nordic_nrf52 = {
6565
.family_id = kNordic_Nrf52_FamilyID,
6666
.default_reset_type = kSoftwareReset,
6767
.soft_reset_type = SYSRESETREQ,
68-
.swd_set_target_reset = swd_set_target_reset,
68+
.swd_set_target_reset = swd_set_target_reset_nrf,
6969
};

source/family/nxp/lpc55S6X/target_reset.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define DEBUGMB_RET 0x02000008
3737
#define DEBUGMB_ID 0x020000FC
3838

39-
static uint8_t target_set_state(TARGET_RESET_STATE state)
39+
static uint8_t lpc55s6x_target_set_state(TARGET_RESET_STATE state)
4040
{
4141
uint32_t val;
4242
int8_t ap_retries = 2;
@@ -108,7 +108,7 @@ static uint8_t target_set_state(TARGET_RESET_STATE state)
108108

109109
const target_family_descriptor_t g_target_family_lpc55S6X = {
110110
.family_id = VENDOR_TO_FAMILY(kNXP_VendorID, 0), //ID not maching the predefined family ids
111-
.target_set_state = target_set_state,
111+
.target_set_state = lpc55s6x_target_set_state,
112112
};
113113

114114
const target_family_descriptor_t *g_target_family = &g_target_family_lpc55S6X;

source/family/nxp/target_reset_lpc4088.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void prerun_target_config(void)
5151
}
5252

5353

54-
static uint8_t target_set_state(TARGET_RESET_STATE state)
54+
static uint8_t lpc4088_target_set_state(TARGET_RESET_STATE state)
5555
{
5656
//return swd_set_target_state_hw(state);
5757
uint8_t res;
@@ -72,7 +72,7 @@ static uint8_t target_set_state(TARGET_RESET_STATE state)
7272
const target_family_descriptor_t g_nxp_lpc4088 = {
7373
.family_id = VENDOR_TO_FAMILY(kNXP_VendorID, 0), //ID not maching the predefined family ids
7474
.prerun_target_config = prerun_target_config,
75-
.target_set_state = target_set_state,
75+
.target_set_state = lpc4088_target_set_state,
7676
};
7777

7878
const target_family_descriptor_t *g_target_family = &g_nxp_lpc4088;

source/family/realtek/target_reset_realtek_rtl8195am.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
#include "DAP_config.h"
2020
#include "target_family.h"
2121

22-
static void swd_set_target_reset(uint8_t asserted)
22+
static void swd_set_target_reset_realtek(uint8_t asserted)
2323
{
2424
if (asserted) {
2525
swd_write_word(0xE000ED0C, 0x05FA0004);
2626
}
2727
}
2828

29-
static uint8_t validate_bin_nvic(const uint8_t *buf)
29+
static uint8_t validate_bin_nvic_realtek(const uint8_t *buf)
3030
{
3131
const char header[] = {0x99, 0x99, 0x96, 0x96, 0x3F, 0xCC, 0x66, 0xFC,
3232
0xC0, 0x33, 0xCC, 0x03, 0xE5, 0xDC, 0x31, 0x62};
@@ -37,6 +37,6 @@ static uint8_t validate_bin_nvic(const uint8_t *buf)
3737
const target_family_descriptor_t g_realtek_rtl8195am = {
3838
.family_id = kRealtek_Rtl8195am_FamilyID,
3939
.default_reset_type = kHardwareReset,
40-
.swd_set_target_reset = swd_set_target_reset,
41-
.validate_bin_nvic = validate_bin_nvic,
40+
.swd_set_target_reset = swd_set_target_reset_realtek,
41+
.validate_bin_nvic = validate_bin_nvic_realtek,
4242
};

0 commit comments

Comments
 (0)