Skip to content

Commit 71b2166

Browse files
committed
Fix warning for __run_user_rf_pre_init declaration
1 parent 6079652 commit 71b2166

File tree

1 file changed

+30
-34
lines changed

1 file changed

+30
-34
lines changed

hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_phy.c

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/*
1+
/*
22
phy.c - ESP8266 PHY initialization data
33
44
Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.
55
This file is part of the esp8266 core for Arduino environment.
6-
6+
77
This library is free software; you can redistribute it and/or
88
modify it under the terms of the GNU Lesser General Public
99
License as published by the Free Software Foundation; either
@@ -24,7 +24,7 @@
2424
#include <stddef.h>
2525
#include <stdbool.h>
2626

27-
static uint8_t phy_init_data[128] =
27+
static uint8_t phy_init_data[128] =
2828
{
2929
[0] = 5, // Reserved, do not change
3030
[1] = 0, // Reserved, do not change
@@ -157,28 +157,28 @@ static uint8_t phy_init_data[128] =
157157

158158
// lp_rf_stg10
159159
// the attenuation of RF gain stage 0 and 1,
160-
// 0xf: 0db,
161-
// 0xe: -2.5db,
162-
// 0xd: -6db,
163-
// 0x9: -8.5db,
164-
// 0xc: -11.5db,
165-
// 0x8: -14db,
166-
// 0x4: -17.5,
160+
// 0xf: 0db,
161+
// 0xe: -2.5db,
162+
// 0xd: -6db,
163+
// 0x9: -8.5db,
164+
// 0xc: -11.5db,
165+
// 0x8: -14db,
166+
// 0x4: -17.5,
167167
// 0x0: -23
168168
[94] = 0x00,
169169

170170

171171
// lp_bb_att_ext
172172
// the attenuation of BB gain,
173-
// 0: 0db,
174-
// 1: -0.25db,
175-
// 2: -0.5db,
176-
// 3: -0.75db,
177-
// 4: -1db,
178-
// 5: -1.25db,
179-
// 6: -1.5db,
180-
// 7: -1.75db,
181-
// 8: -2db
173+
// 0: 0db,
174+
// 1: -0.25db,
175+
// 2: -0.5db,
176+
// 3: -0.75db,
177+
// 4: -1db,
178+
// 5: -1.25db,
179+
// 6: -1.5db,
180+
// 7: -1.75db,
181+
// 8: -2db
182182
// max valve is 24(-6db)
183183
[95] = 0,
184184

@@ -198,17 +198,17 @@ static uint8_t phy_init_data[128] =
198198
// vdd33_const
199199
// the voltage of PA_VDD
200200
// x=0xff: it can measure VDD33,
201-
// 18<=x<=36: use input voltage,
201+
// 18<=x<=36: use input voltage,
202202
// the value is voltage*10, 33 is 3.3V, 30 is 3.0V,
203203
// x<18 or x>36: default voltage is 3.3V
204204
//
205205
// the value of this byte depend from the TOUT pin usage (1 or 2):
206-
// 1)
206+
// 1)
207207
// analogRead function (system_adc_read()):
208208
// is only available when wire TOUT pin17 to external circuitry, Input Voltage Range restricted to 0 ~ 1.0V.
209209
// For this function the vdd33_const must be set as real power voltage of VDD3P3 pin 3 and 4
210210
// The range of operating voltage of ESP8266 is 1.8V~3.6V,the unit of vdd33_const is 0.1V,so effective value range of vdd33_const is [18,36]
211-
// 2)
211+
// 2)
212212
// getVcc function (system_get_vdd33):
213213
// is only available when TOUT pin17 is suspended (floating), this function measure the power voltage of VDD3P3 pin 3 and 4
214214
// For this function the vdd33_const must be set to 255 (0xFF).
@@ -220,7 +220,7 @@ static uint8_t phy_init_data[128] =
220220
// freq_correct_en
221221
// bit[0]:0->do not correct frequency offset, 1->correct frequency offset.
222222
// bit[1]:0->bbpll is 168M, it can correct + and - frequency offset, 1->bbpll is 160M, it only can correct + frequency offset
223-
// bit[2]:0->auto measure frequency offset and correct it, 1->use 113 byte force_freq_offset to correct frequency offset.
223+
// bit[2]:0->auto measure frequency offset and correct it, 1->use 113 byte force_freq_offset to correct frequency offset.
224224
// 0: do not correct frequency offset.
225225
// 1: auto measure frequency offset and correct it, bbpll is 168M, it can correct + and - frequency offset.
226226
// 3: auto measure frequency offset and correct it, bbpll is 160M, it only can correct + frequency offset.
@@ -239,17 +239,6 @@ extern int __wrap_register_chipv6_phy(uint8_t* unused) {
239239
return __real_register_chipv6_phy(phy_init_data);
240240
}
241241

242-
243-
void user_rf_pre_init() {
244-
// *((volatile uint32_t*) 0x60000710) = 0;
245-
246-
volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
247-
rtc_reg[30] = 0;
248-
249-
system_set_os_print(0);
250-
__run_user_rf_pre_init();
251-
}
252-
253242
extern int __get_rf_mode(void) __attribute__((weak));
254243
extern int __get_rf_mode(void)
255244
{
@@ -268,5 +257,12 @@ extern void __run_user_rf_pre_init(void)
268257
return; // default do noting
269258
}
270259

260+
void user_rf_pre_init() {
261+
// *((volatile uint32_t*) 0x60000710) = 0;
271262

263+
volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
264+
rtc_reg[30] = 0;
272265

266+
system_set_os_print(0);
267+
__run_user_rf_pre_init();
268+
}

0 commit comments

Comments
 (0)