diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7417814..027c27e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,18 @@ # Contributing -- New "apps" should be added as examples in the library (`library/examples/`) - Keep pull requests limited to a single thing (fixing an issue in an existing app, adding a new app, or fixing an issue in the library) -- If modifying the library compile and flash the `HardwareDemo` example to - ensure things still work +## Coding standards + +- Keep clang-format happy +- Member variables are prefixed with `m_` +- Global variables are prefixed with `g_` +- The order of declaration in class headers is (each of which should be in their + own scope region, i.e. don't mix private variables and functions): + - public constants + - public functions + - protected functions + - private functions + - protected variables + - private variables diff --git a/firmware/AppManager/src/NeoTestApp.h b/firmware/AppManager/src/NeoTestApp.h index 16a9c8b..2c304ac 100644 --- a/firmware/AppManager/src/NeoTestApp.h +++ b/firmware/AppManager/src/NeoTestApp.h @@ -17,18 +17,20 @@ class NeoTestApp : public App NeoTestApp() : App("NeoTestApp") { - m_patterns[0] = new RainbowCycle(m_badge->neoPixels(), 20); - m_patterns[1] = new RainbowChase(m_badge->neoPixels(), 50); - m_currentPattern = 0; } ~NeoTestApp() { - for (size_t i = 0; i < PATTERN_COUNT; i++) - { - if (m_patterns[i]) - delete m_patterns[i]; - } + } + + /** + * @copydoc App:create + */ + void create() + { + m_patterns[0] = new RainbowCycle(m_badge->neoPixels(), 20); + m_patterns[1] = new RainbowChase(m_badge->neoPixels(), 50); + m_currentPattern = 0; } /** @@ -52,6 +54,18 @@ class NeoTestApp : public App m_badge->display().println("Long press B to return to app menu.\n"); } + /** + * @copydoc App:destroy + */ + void destroy() + { + for (size_t i = 0; i < PATTERN_COUNT; i++) + { + if (m_patterns[i]) + delete m_patterns[i]; + } + } + /** * @copydoc App:handleButton */