Project

General

Profile

Statistics
| Branch: | Revision:

pse-2015-16-grupo-3 / tpf / power.c @ 87a830c5

History | View | Annotate | Download (756 Bytes)

1
#include "power.h"
2
#include "display.h"
3

    
4
#define antigo
5

    
6
// Power Settings
7
static uint16_t powerSettings[] = {150, 350, 500, 750};
8
static uint8_t powerSettingsIndex=0;
9

    
10

    
11
uint8_t nextPowerSetting()
12
{
13
    powerSettingsIndex++;
14
    if(powerSettingsIndex>3)
15
    {
16
        powerSettingsIndex=0;
17
    }
18
    
19
    setDisplayPower(powerSettings[powerSettingsIndex]);
20
    
21
    return 0;
22
}
23

    
24
uint8_t previousPowerSetting()
25
{
26
    if(powerSettingsIndex == 0)
27
    {
28
        powerSettingsIndex=3;
29
    }
30
    else
31
    {
32
        powerSettingsIndex--;
33
    }
34
    
35
    setDisplayPower(powerSettings[powerSettingsIndex]);
36
    
37
    return 0;
38
}
39

    
40

    
41
#ifndef antigo
42
uint8_t setPower(uint8_t powerValue, time_t execTime)
43
{
44
    return 0;
45
}
46

    
47
uint8_t clearPower()
48
{
49
    return 0;
50
}
51

    
52
#endif