diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-12-08 14:42:32 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-12-08 14:42:32 +0000 |
commit | cbbacdb239211fc33b0423b1213d2e58ac1692da (patch) | |
tree | 87b6a0de2bfe60c72113b3d9c6efb199aabb198b /demos/AVR-ATmega128-GCC/board.c | |
parent | e3538a6583b6a269bfabb7b27166dc5296a61879 (diff) | |
download | ChibiOS-cbbacdb239211fc33b0423b1213d2e58ac1692da.tar.gz ChibiOS-cbbacdb239211fc33b0423b1213d2e58ac1692da.tar.bz2 ChibiOS-cbbacdb239211fc33b0423b1213d2e58ac1692da.zip |
HAL support for AVR.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1394 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/AVR-ATmega128-GCC/board.c')
-rw-r--r-- | demos/AVR-ATmega128-GCC/board.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/demos/AVR-ATmega128-GCC/board.c b/demos/AVR-ATmega128-GCC/board.c index 84e1565cb..8a9a69309 100644 --- a/demos/AVR-ATmega128-GCC/board.c +++ b/demos/AVR-ATmega128-GCC/board.c @@ -17,10 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <ch.h>
-#include <serial.h>
-
-#include "board.h"
+#include "ch.h"
+#include "hal.h"
CH_IRQ_HANDLER(TIMER0_COMP_vect) {
@@ -71,16 +69,16 @@ void hwinit(void) { /*
* Timer 0 setup.
*/
- TCCR0 = (1 << WGM01) | (0 << WGM00) | // CTC mode.
- (0 << COM01) | (0 << COM00) | // OC0A disabled (normal I/O).
- (1 << CS02) | (0 << CS01) | (0 << CS00); // CLK/64 clock source.
+ TCCR0 = (1 << WGM01) | (0 << WGM00) | /* CTC mode. */
+ (0 << COM01) | (0 << COM00) | /* OC0A disabled. */
+ (1 << CS02) | (0 << CS01) | (0 << CS00); /* CLK/64 clock. */
OCR0 = F_CPU / 64 / CH_FREQUENCY - 1;
- TCNT0 = 0; // Reset counter.
- TIFR = (1 << OCF0); // Reset pending (if any).
- TIMSK = (1 << OCIE0); // Interrupt on compare.
+ TCNT0 = 0; /* Reset counter. */
+ TIFR = (1 << OCF0); /* Reset pending. */
+ TIMSK = (1 << OCIE0); /* IRQ on compare. */
/*
- * Other initializations.
+ * HAL initialization.
*/
- sdInit();
+ halInit();
}
|