Skip to content

Commit

Permalink
Merge branch 'master' into platformio_build
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Aug 14, 2016
2 parents a22c0d9 + 9de15e7 commit c370d3f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
16 changes: 13 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
30 changes: 22 additions & 8 deletions firmware/AppManager/src/NeoTestApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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
*/
Expand Down

0 comments on commit c370d3f

Please sign in to comment.