void app_main(void)
{
int resetSettingsInx=0;
delay_ms(100);
esp_log_level_set("wifi", ESP_LOG_NONE);
delay_ms(100);
// initialize NVS
ESP_ERROR_CHECK(nvs_flash_init());
esp_rom_spiflash_config_param (0x1540ef, 4*1024*1024, 64*1024, 4096, 256, 0xffff);
//--------------
gpio_setup();
gpio_set_level(GPIO_ROLE, 0);
gpio_set_level(GPIO_LED_KIRMIZI, 1);
gpio_set_level(GPIO_LED_YESIL, 1);
gpio_set_level(GPIO_BUZZER, 1);
//--------------
for( int i=0;i<7;i++ ) {
if( gpio_get_level( GPIO_SW1 ) == 1 ) break;
resetSettingsInx++;
printf("\n SW1:ON inx:%d\n",resetSettingsInx);
gpio_set_level(GPIO_BUZZER, 0);
delay_ms(300);
gpio_set_level(GPIO_BUZZER, 1);
delay_ms(700);
}
//--------------
// vTaskDelay(5000 / portTICK_PERIOD_MS);
delay_ms(50);
//--------------
// esp_base_mac_addr_set();
tcpip_adapter_init();
wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
// vTaskDelay(2000 / portTICK_PERIOD_MS);
delay_ms(50);
mf_lastcard_id[0]=0;mf_lastcard_id[1]=0;mf_lastcard_id[2]=0;mf_lastcard_id[3]=0;
esp_efuse_mac_get_default(mac_addr);
esp_efuse_read_mac(mac_addr2);
delay_ms(100);
readSettingsFromFlash();
Comments