File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 24
24
#include <stddef.h>
25
25
#include <stdbool.h>
26
26
27
- static uint8_t phy_init_data [128 ] =
27
+ #include "c_types.h"
28
+
29
+ static const uint8_t ICACHE_FLASH_ATTR phy_init_data [128 ] =
28
30
{
29
31
[0 ] = 5 , // Reserved, do not change
30
32
[1 ] = 0 , // Reserved, do not change
@@ -241,9 +243,12 @@ static uint8_t phy_init_data[128] =
241
243
};
242
244
243
245
extern int __real_register_chipv6_phy (uint8_t * init_data );
244
- extern int __wrap_register_chipv6_phy (uint8_t * unused ) {
245
- phy_init_data [107 ] = __get_adc_mode ();
246
- return __real_register_chipv6_phy (phy_init_data );
246
+ extern int __wrap_register_chipv6_phy (uint8_t * init_data ) {
247
+ if (init_data != NULL ) {
248
+ memcpy (init_data , phy_init_data , sizeof (phy_init_data ));
249
+ init_data [107 ] = __get_adc_mode ();
250
+ }
251
+ return __real_register_chipv6_phy (init_data );
247
252
}
248
253
249
254
extern int __get_rf_mode (void ) __attribute__((weak ));
You can’t perform that action at this time.
0 commit comments