utils_blynk.cpp
BLYNK_WRITE(V1)
{
	// Blynk.syncAll() causes an initial write.
	// Ignore it !!!
	static bool first_time = true;
	if (first_time)
	{
		first_time = false;
		return;
	}

	// If switch was "long pressed" for 3 seconds,
	// move the board to SPIFFS OTA mode
	if (!switch_time)
	{
		switch_time = millis();
	}
	else
	{
		uint32_t high_time = millis() - switch_time;

		if (high_time > BLYNK_LONG_PRESS_INTERVAL)
		{
			set_op_mode(MODE_SPIFFS_OTA);
			blink_led(5);
		}

		switch_time = 0;
	}
}
/*
   Virtual pin V1 used to move board to SPIFFS OTA mode
 */
Virtual pin V1 used to move board to SPIFFS OTA mode
Virtual pin V1 used to move board to SPIFFS OTA mode
BLYNK_WRITE(V1)
{
	static bool first_time = true;
	if (first_time)
	{
		first_time = false;
		return;
	}
	if (!switch_time)
	{
		switch_time = millis();
	}
	else
	{
		uint32_t high_time = millis() - switch_time;
		if (high_time > BLYNK_LONG_PRESS_INTERVAL)
		{
			set_op_mode(MODE_SPIFFS_OTA);
			blink_led(5);
		}
		switch_time = 0;
	}
}
BLYNK_WRITE ( V1 ) { static bool first_time = true ; if ( first_time ) { first_time = false ; return ; } if ( ! switch_time ) { switch_time = millis ( ) ; } else { uint32_t high_time = millis ( ) - switch_time ; if ( high_time > BLYNK_LONG_PRESS_INTERVAL ) { set_op_mode ( MODE_SPIFFS_OTA ) ; blink_led ( 5 ) ; } switch_time = 0 ; } }
Virtual pin V1 used to move board to SPIFFS OTA mode
Virtual pin V1 used to move board to SPIFFS OTA mode
// Blynk.syncAll() causes an initial write. // Ignore it !!! // If switch was "long pressed" for 3 seconds, // move the board to SPIFFS OTA mode