tetris/game-ctrl/main.c

57 lines
919 B
C
Raw Normal View History

2024-03-07 15:51:44 +01:00
#include <msp430g2553.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include "time.h"
2024-03-18 12:51:57 +01:00
#include "scheduler.h"
2024-03-08 09:57:47 +01:00
#include "canvas.h"
2024-03-13 17:35:46 +01:00
#include "game.h"
2024-03-14 14:46:31 +01:00
#include "buttons.h"
#include "shapes.h"
2024-03-21 11:34:20 +01:00
#include "myrand.h"
#include "spi.h"
2024-03-22 18:38:30 +01:00
#include "display.h"
2024-04-19 11:38:32 +02:00
#include "eeprom.h"
2024-05-18 20:09:21 +02:00
#include "config.h"
2024-05-21 12:31:55 +02:00
#include "sound.h"
2024-03-07 15:51:44 +01:00
int main() {
WDTCTL = WDTPW | WDTHOLD;
__disable_interrupt();
// highest possible system clock
DCOCTL = DCO0 | DCO1 | DCO2;
BCSCTL1 = XT2OFF | RSEL0 | RSEL1 | RSEL2 | RSEL3;
BCSCTL2 = 0;
BCSCTL3 = 0;
schInit();
spiInit();
2024-04-19 11:38:32 +02:00
eepromInit();
2024-03-22 18:38:30 +01:00
displayInit();
2024-03-21 11:34:20 +01:00
myRandInit();
2024-03-08 09:57:47 +01:00
canvasInit();
2024-05-21 12:31:55 +02:00
soundInit();
2024-03-14 14:46:31 +01:00
buttonsInit();
2024-03-07 15:51:44 +01:00
2024-05-21 13:43:40 +02:00
eepromShowValues();
2024-05-18 20:09:21 +02:00
if (isConfigMode()) {
configInit();
} else {
shapesInit();
gameInit();
buttonsStart();
}
2024-03-07 15:51:44 +01:00
__enable_interrupt();
while (1) {
schExec();
}
}