paul@6 | 1 | /* |
paul@6 | 2 | * Ben NanoNote stage 2 payload test. |
paul@6 | 3 | * |
paul@33 | 4 | * Copyright (C) Wolfgang Spraul <wolfgang@sharism.cc> |
paul@118 | 5 | * Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk> |
paul@6 | 6 | * |
paul@63 | 7 | * This program is free software: you can redistribute it and/or modify |
paul@63 | 8 | * it under the terms of the GNU General Public License as published by |
paul@63 | 9 | * the Free Software Foundation, either version 3 of the License, or |
paul@63 | 10 | * (at your option) any later version. |
paul@6 | 11 | * |
paul@63 | 12 | * This program is distributed in the hope that it will be useful, |
paul@63 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@63 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@63 | 15 | * GNU General Public License for more details. |
paul@6 | 16 | * |
paul@63 | 17 | * You should have received a copy of the GNU General Public License |
paul@63 | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
paul@6 | 19 | */ |
paul@6 | 20 | |
paul@64 | 21 | #include "board-specific.h" |
paul@34 | 22 | |
paul@68 | 23 | #include "irq.h" |
paul@15 | 24 | #include "lcd.h" |
paul@68 | 25 | #include "cpu.h" |
paul@6 | 26 | |
paul@6 | 27 | void c_main(void) |
paul@6 | 28 | { |
paul@54 | 29 | volatile int started; |
paul@18 | 30 | |
paul@73 | 31 | init_tlb(); |
paul@68 | 32 | flush_cache_all(); |
paul@68 | 33 | |
paul@18 | 34 | /* The actual work. */ |
paul@18 | 35 | |
paul@54 | 36 | started = is_started(); |
paul@118 | 37 | |
paul@118 | 38 | if (!started) |
paul@118 | 39 | { |
paul@54 | 40 | gpio_init2(); |
paul@54 | 41 | cpm_init(); |
paul@54 | 42 | rtc_init(); |
paul@54 | 43 | timer_init(); |
paul@54 | 44 | } |
paul@118 | 45 | |
paul@15 | 46 | lcd_init(); |
paul@68 | 47 | irq_init(); |
paul@118 | 48 | |
paul@68 | 49 | start_task(); |
paul@118 | 50 | |
paul@118 | 51 | while (1) asm volatile("wait"); |
paul@6 | 52 | } |