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 2424 #include <stddef.h>
2525 #include <stdbool.h>
2626
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 ] =
2830{
2931 [0 ] = 5 , // Reserved, do not change
3032 [1 ] = 0 , // Reserved, do not change
@@ -241,9 +243,12 @@ static uint8_t phy_init_data[128] =
241243};
242244
243245extern 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 );
247252}
248253
249254extern int __get_rf_mode (void ) __attribute__((weak ));
You can’t perform that action at this time.
0 commit comments