Então PARA...

Dependencies:   MenuLCD mbed

menbed/menbedMenuParam.cpp

Committer:
ViniR
Date:
2017-05-19
Revision:
0:92357d1220f3

File content as of revision 0:92357d1220f3:

#include "mbed.h"
#include "include/menbedMenuParam.h"
#include  <string>

MenbedMenuParam::MenbedMenuParam (
    float (*initValFcn)(void), void (*finalValFcn)(float),
    bool liveUpdate, float min, float max,
    float inc) : 
    initValFcn(initValFcn), finalValFcn(finalValFcn), _liveUpdate(liveUpdate),
    _min(min), _max(max), _inc(inc)    
{
}


float MenbedMenuParam::getVal (void)
{
    if (initValFcn == NULL)
        return 0.0;
        
    return initValFcn();
}

void MenbedMenuParam::setVal (float v)
{
    if (finalValFcn == NULL)
        return;
        
    finalValFcn(v);
}