Utils is only used within TouchGFX.
 
Symbols
loading...
Files
loading...

Utils class

Syntax

class Utils { public:     static int randomNumberBetween(int lowest, int highest)      { #ifdef SIMULATOR         return lowest + (highest-lowest) * rand() / RAND_MAX; #else         uint32_t random = (touchgfx::HAL::getInstance()->getCPUCycles() * HAL::getInstance()->getCPUCycles());         return lowest + (random % (highest-lowest)); #endif     } };

Methods

randomNumberBetween()

No summary provided. Read more...

References

LocationReferrerText
Utils.hpp:27
class Utils
CustomControlsView.cpp:170CustomControlsView::handleTickEvent()
int newValue = value + Utils::randomNumberBetween(-6, 18);
CustomControlsView.cpp:195CustomControlsView::startThreeWayProgressBarAnimation()
animationDuration[i] = Utils::randomNumberBetween(100, 200);
CustomControlsView.cpp:223CustomControlsView::getRandomEasingEquation()
switch (Utils::randomNumberBetween(0, 6))
CustomControlsView.cpp:342CustomControlsView::screenSaverMinorTick()
if (Utils::randomNumberBetween(0, 100) < 50)
Game2DView.cpp:181Game2DView::handleTickEvent()
if (Utils::randomNumberBetween(0, 100) < 8)
Game2DView.cpp:207Game2DView::handleTickEvent()
if (Utils::randomNumberBetween(0, 100) < 3)
GraphView.cpp:222GraphView::handleTickEvent()
primaryGraph.addValue(graphX, (int)((CWRUtil::toQ5(150) * CWRUtil::sine(graphX + Utils::randomNumberBetween(-25, 25))).to<int>()) + 200 + Utils::randomNumberBetween(-50, 50));
GraphView.cpp:223GraphView::handleTickEvent()
secondaryGraph.addValue(graphX, (int)((CWRUtil::toQ5(150) * CWRUtil::sine(graphX+230)).to<int>()) + 200 + Utils::randomNumberBetween(-50, 50));
GraphView.cpp:242GraphView::handleTickEvent()
value1 = Utils::randomNumberBetween(graph1min, graph1max);
GraphView.cpp:243GraphView::handleTickEvent()
value2 = Utils::randomNumberBetween(graph2min, graph2max);
GraphView.cpp:253GraphView::handleTickEvent()
value1 += Utils::randomNumberBetween(-randomMax, randomMax);
GraphView.cpp:254GraphView::handleTickEvent()
value2 += Utils::randomNumberBetween(-randomMax, randomMax);
GraphView.cpp:255GraphView::handleTickEvent()
if (value1 < graph1min) value1 += Utils::randomNumberBetween(randomMax, 2*randomMax);
GraphView.cpp:256GraphView::handleTickEvent()
if (value1 > graph1max) value1 -= Utils::randomNumberBetween(randomMax, 2*randomMax);
GraphView.cpp:257GraphView::handleTickEvent()
if (value2 < graph2min) value2 += Utils::randomNumberBetween(randomMax, 2*randomMax);
GraphView.cpp:258GraphView::handleTickEvent()
if (value2 > graph2max) value2 -= Utils::randomNumberBetween(randomMax, 2*randomMax);
GraphView.cpp:474GraphView::resetPieChart()
shares[i] = Utils::randomNumberBetween(10, 100);
GraphView.cpp:609GraphView::screenSaverMajorTick()
if (Utils::randomNumberBetween(0, 100) < 50)