IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
| Source at commit cec05a0f5ea2fb4ff5637d418c7f5dae196abda8 created 6 years 9 months ago. By Werner Almesberger, atusb/atusb.pro: we don't use power.lib anymore | |
|---|---|
| 1 | /* |
| 2 | * fw/atusb.c - ATUSB initialization and main loop |
| 3 | * |
| 4 | * Written 2008-2011 by Werner Almesberger |
| 5 | * Copyright 2008-2011 Werner Almesberger |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | */ |
| 12 | |
| 13 | |
| 14 | #include <stdint.h> |
| 15 | |
| 16 | #include <avr/io.h> |
| 17 | #include <avr/sleep.h> |
| 18 | #include <avr/interrupt.h> |
| 19 | |
| 20 | #include "usb.h" |
| 21 | |
| 22 | #include "board.h" |
| 23 | #include "sernum.h" |
| 24 | #include "spi.h" |
| 25 | #include "atusb/ep0.h" |
| 26 | |
| 27 | |
| 28 | int main(void) |
| 29 | { |
| 30 | board_init(); |
| 31 | board_app_init(); |
| 32 | reset_rf(); |
| 33 | |
| 34 | user_get_descriptor = sernum_get_descr; |
| 35 | |
| 36 | /* now we should be at 8 MHz */ |
| 37 | |
| 38 | usb_init(); |
| 39 | ep0_init(); |
| 40 | #ifdef ATUSB |
| 41 | timer_init(); |
| 42 | |
| 43 | /* move interrupt vectors to 0 */ |
| 44 | MCUCR = 1 << IVCE; |
| 45 | MCUCR = 0; |
| 46 | #endif |
| 47 | |
| 48 | sei(); |
| 49 | |
| 50 | while (1) |
| 51 | sleep_mode(); |
| 52 | } |
| 53 | |
