This repository has been archived on 2024-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
game-ctrl-01/led.c

48 lines
556 B
C
Raw Normal View History

2024-03-07 15:51:44 +01:00
#include "led.h"
#include <msp430g2553.h>
#include "PontCoopScheduler.h"
#include <stdlib.h>
void ledGreenOn() {
P1OUT |= BIT0;
}
void ledGreenOff() {
P1OUT &= ~BIT0;
}
void ledBlueOn() {
P1OUT |= BIT1;
}
void ledBlueOff() {
P1OUT &= ~BIT1;
}
2024-03-08 09:57:47 +01:00
void ledExec(void *args) {
2024-03-07 15:51:44 +01:00
static int i = 0;
if (i == 0) {
ledGreenOff();
i = 1;
} else {
ledGreenOn();
i = 0;
}
}
void ledInit() {
// BIT0: green
// BIT1: blue
P1DIR |= BIT0|BIT1;
2024-03-08 09:57:47 +01:00
ledGreenOff();
ledBlueOff();
// schAdd(ledExec, NULL, 0, 50);
2024-03-07 15:51:44 +01:00
}