This commit is contained in:
Wolfgang Hottgenroth
2015-03-04 21:00:09 +01:00
parent 34f0393254
commit 55dcc6ebb0
2 changed files with 10 additions and 17 deletions

View File

@ -11,6 +11,8 @@
#include "hmi.h"
#include "pwm.h"
#include "mySpi.h"
#include "display.h"
class SwitchPort2 {
@ -65,6 +67,8 @@ SwitchPort2 switch2 = SwitchPort2(BIT1);
SwitchPort2 switch3 = SwitchPort2(BIT2);
void hmiInit() {
spiInit();
dispInit();
}
void hmiExec() {
@ -77,4 +81,7 @@ void hmiExec() {
if (switch3.get()) {
setUDes(getUDes() + 1.0);
}
dispSetFloat(0, getUDes());
dispSetFloat(1, getUCur());
}

View File

@ -11,8 +11,6 @@
#include "pwm.h"
#include "hmi.h"
#include "mySpi.h"
#include "display.h"
@ -30,26 +28,14 @@ void init() {
int main() {
init();
//pwmInit();
//hmiInit();
spiInit();
dispInit();
pwmInit();
hmiInit();
dispSetFloat(0, -12.99);
dispSetFloat(1, 990.99);
__enable_interrupt();
uint32_t c = 0;
uint16_t d = 0;
while (1) {
// hmiExec();
c++;
if (c > 1000000) {
c = 0;
d++;
// dispSetDigit(0, 1);
}
hmiExec();
}
}