2007-10-04 17:39:44 +00:00
|
|
|
/*
|
|
|
|
ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
|
|
|
|
|
|
|
|
This file is part of ChibiOS/RT.
|
|
|
|
|
|
|
|
ChibiOS/RT is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
ChibiOS/RT is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <ch.h>
|
|
|
|
|
2007-10-23 18:43:39 +00:00
|
|
|
#include <avr/io.h>
|
|
|
|
|
|
|
|
void hwinit(void) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* I/O ports setup.
|
|
|
|
* Everything configured as input with pull-up initially.
|
|
|
|
*/
|
|
|
|
DDRA = 0;
|
|
|
|
PORTA = 0xFF;
|
|
|
|
DDRB = 0;
|
|
|
|
PORTB = 0xFF;
|
|
|
|
DDRC = 0;
|
|
|
|
PORTC = 0xFF;
|
|
|
|
DDRD = 0;
|
|
|
|
PORTD = 0xFF;
|
|
|
|
DDRE = 0;
|
|
|
|
PORTE = 0xFF;
|
|
|
|
DDRF = 0;
|
|
|
|
PORTF = 0xFF;
|
|
|
|
DDRG = 0;
|
|
|
|
PORTG = 0xFF;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enables Idle mode for SLEEP instruction.
|
|
|
|
*/
|
|
|
|
SMCR = 1;
|
|
|
|
}
|
|
|
|
|
2007-10-06 10:22:07 +00:00
|
|
|
void chSysPause(void) {
|
|
|
|
|
|
|
|
chThdSetPriority(IDLEPRIO);
|
|
|
|
|
|
|
|
while (TRUE) {
|
2007-10-23 18:43:39 +00:00
|
|
|
// asm volatile ("sleep");
|
2007-10-06 10:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-04 17:39:44 +00:00
|
|
|
void chSysHalt(void) {
|
|
|
|
|
2007-10-06 10:22:07 +00:00
|
|
|
chSysLock();
|
|
|
|
|
2007-10-04 17:39:44 +00:00
|
|
|
while (TRUE)
|
|
|
|
;
|
|
|
|
}
|