Implications of customized system firmware - Photon

The develop branch now contains a preliminary implementation of system events. Here’s a test app that programmatically enables listening mode, and turns it off after 3 seconds. If the user then presses the mode button to enter listening mode, it’s also exited after 3 seconds.

#include "application.h"

SYSTEM_MODE(SEMI_AUTOMATIC);

void listen(system_event_t event, uint32_t param, void* pointer)
{
    if (event==wifi_listen_update)
    {
        // exit listen mode after 3 seconds
        if (param>3000) {
            WiFi.listen(false); 
        }
    }
}

void setup()
{
    WiFi.on();
    System.on(wifi_listen, listen);
    WiFi.listen();
}

void loop()
{
}

Does that address your needs for custom system firmware?

10 Likes