Skip to content
Snippets Groups Projects
Commit 54cbd34e authored by Bradley Eaton's avatar Bradley Eaton
Browse files

Moved fortuna os things into mines.c and mines.h

parent 1a570758
No related branches found
No related tags found
No related merge requests found
Pipeline #7425 passed
#ifndef OS_H_
#define OS_H_
#endif // OS_H_
/* COMP2215 Task 5---SKELETON */
#include "os.h"
/* Loosly Based on COMP2215 Task 5---SKELETON */
#include "mines.h"
#include <stdlib.h>
#include <avr/eeprom.h>
int blink(int);
......@@ -467,7 +463,13 @@ void empty(void){
void main(void) {
os_init();
/* 8MHz clock, no prescaling (DS, p. 48) */
CLKPR = (1 << CLKPCE);
CLKPR = 0;
init_lcd();
os_init_scheduler();
os_init_ruota();
// os_add_task( blink, 25, 1);
os_add_task( collect_delta, 200, 1);
......@@ -618,27 +620,6 @@ int check_switches(int state) {
sweep_adjacent(position);
}
// if (get_switch_rpt(_BV(SWN))) {
// display_string("[R] North\n");
// }
//
// if (get_switch_rpt(_BV(SWE))) {
// display_string("[R] East\n");
// }
//
// if (get_switch_rpt(_BV(SWS))) {
// display_string("[R] South\n");
// }
//
// if (get_switch_rpt(_BV(SWW))) {
// display_string("[R] West\n");
// }
//
// if (get_switch_rpt(SWN)) {
// display_string("[R] North\n");
// }
return state;
}
......
#include <stdio.h>
#include <stdlib.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include "lcd.h"
#include "rios.h"
#include "ruota.h"
#ifndef MINES_H_
#define MINES_H_
......
/* _____ _ ___ ____
* | ___|__ _ __| |_ _ _ _ __ __ _ / _ \/ ___|
* | |_ / _ \| '__| __| | | | '_ \ / _` | | | \___ \
* | _| (_) | | | |_| |_| | | | | (_| | |_| |___) |
* |_| \___/|_| \__|\__,_|_| |_|\__,_|\___/|____/
*
*/
#include "os.h"
#include "rios.h"
#include "ruota.h"
void os_init(void) {
/* 8MHz clock, no prescaling (DS, p. 48) */
CLKPR = (1 << CLKPCE);
CLKPR = 0;
// DDRB |= _BV(PB7); /* LED as output */
init_lcd();
os_init_scheduler();
os_init_ruota();
}
/* FortunaOS
_____ _ ___ ____
| ___|___ _ __ | |_ _ _ _ __ __ _ / _ \ / ___|
| |_ / _ \ | '__|| __|| | | || '_ \ / _` || | | |\___ \
| _|| (_) || | | |_ | |_| || | | || (_| || |_| | ___) |
|_| \___/ |_| \__| \__,_||_| |_| \__,_| \___/ |____/
Minimalist Operating System for LaFortuna board, build on:
- The RIOS Scheduler
- Peter Dannegger’s Code for the Rotary Encoder
- Peter Dannegger’s Code for Switch debouncing
- Steve Gunn’s display driver
- ChanN’s FAT File System
Occupies Timer T0 for scheduling and LED brightness.
*/
#ifndef OS_H
#define OS_H
#include <stdio.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include "lcd.h"
#include "rios.h"
#include "ruota.h"
#define LED_ON PORTB |= _BV(PINB7)
#define LED_OFF PORTB &= ~_BV(PINB7)
#define LED_TOGGLE PINB |= _BV(PINB7)
void os_init(void);
#endif /* OS_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment