changes used library for dfplayer
This commit is contained in:
parent
43d31651cd
commit
6997f3c98f
5 changed files with 24 additions and 86 deletions
|
@ -1,17 +1,22 @@
|
|||
#include "Context.h"
|
||||
|
||||
Context::Context(Station* stations, const int stationCount, const unsigned long delta, DFRobotDFPlayerMini* dfPlayer) {
|
||||
this->stations = stations;
|
||||
this->stationCount = stationCount;
|
||||
this->delta = delta;
|
||||
this->dfPlayer = dfPlayer;
|
||||
Context::Context(Station* stations, const int stationCount, const unsigned long delta, DFPlayerMini_Fast* dfPlayer)
|
||||
{
|
||||
this->stations = stations;
|
||||
this->stationCount = stationCount;
|
||||
this->delta = delta;
|
||||
this->dfPlayer = dfPlayer;
|
||||
}
|
||||
|
||||
int Context::getStationIndex(const Station* station) const
|
||||
{
|
||||
for (int i = 0; i < stationCount; ++i) {
|
||||
if (&stations[i] == station) {
|
||||
return i;
|
||||
for (int i = 0; i < stationCount; ++i)
|
||||
{
|
||||
if (&stations[i] == station)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue