2011-05-20 22:53:09 +00:00
|
|
|
#include <sysinit.h>
|
2011-05-11 21:24:05 +00:00
|
|
|
|
2011-07-18 16:25:14 +00:00
|
|
|
#include "core/cpu/cpu.h"
|
|
|
|
#include "core/pmu/pmu.h"
|
2011-05-20 23:12:09 +00:00
|
|
|
|
2011-07-18 16:25:14 +00:00
|
|
|
#include "basic/basic.h"
|
2011-05-20 22:53:09 +00:00
|
|
|
#include "lcd/render.h"
|
2011-08-01 03:22:24 +00:00
|
|
|
#include "filesystem/ff.h"
|
2011-05-11 21:24:05 +00:00
|
|
|
|
2011-08-22 19:59:18 +00:00
|
|
|
|
|
|
|
#ifdef CRP1
|
|
|
|
#define CRP_VALUE 0x12345678 // CRP1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CRP2
|
|
|
|
#define CRP_VALUE 0x87654321 // CRP2
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CRP3
|
|
|
|
#define CRP_VALUE 0x43218765 // CRP3
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NO_ISP
|
|
|
|
#define CRP_VALUE 0x4e697370 // NO_ISP
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CRP_VALUE
|
|
|
|
#define CRP_VALUE 0x0 // ANY non-magic value disables CRP
|
|
|
|
#endif
|
|
|
|
|
2011-12-11 15:13:29 +00:00
|
|
|
//__attribute__ ((used, section("crp"))) const uint32_t the_crp=CRP_VALUE;
|
2011-08-05 14:13:14 +00:00
|
|
|
|
2011-05-20 22:53:09 +00:00
|
|
|
/**************************************************************************/
|
2011-05-11 21:24:05 +00:00
|
|
|
|
2011-05-21 10:05:48 +00:00
|
|
|
void wrapper(void);
|
|
|
|
|
2011-05-20 22:53:09 +00:00
|
|
|
int main(void) {
|
|
|
|
// Configure cpu and mandatory peripherals
|
2011-07-09 20:13:46 +00:00
|
|
|
cpuInit(); // Configure the CPU
|
|
|
|
// we do it later
|
|
|
|
// systickInit(CFG_SYSTICK_DELAY_IN_MS); // Start systick timer
|
|
|
|
// cpuInit already calls this
|
|
|
|
// gpioInit(); // Enable GPIO
|
|
|
|
pmuInit(); // Configure power management
|
|
|
|
adcInit(); // Config adc pins to save power
|
2011-05-11 21:24:05 +00:00
|
|
|
|
2011-05-20 22:53:09 +00:00
|
|
|
// initialise basic badge functions
|
|
|
|
rbInit();
|
2011-07-26 22:57:36 +00:00
|
|
|
|
2011-05-20 22:53:09 +00:00
|
|
|
|
2011-05-20 23:12:09 +00:00
|
|
|
lcdInit(); // display
|
2011-05-11 21:24:05 +00:00
|
|
|
|
2011-05-21 01:05:57 +00:00
|
|
|
lcdFill(0);
|
2011-07-18 20:09:31 +00:00
|
|
|
lcdDisplay();
|
2011-12-17 21:32:49 +00:00
|
|
|
|
2011-12-23 12:22:13 +00:00
|
|
|
switch(getInputRaw()){
|
|
|
|
case BTN_ENTER:
|
|
|
|
lcdPrint("ISP active");
|
|
|
|
lcdRefresh();
|
|
|
|
ReinvokeISP();
|
|
|
|
break;
|
|
|
|
case BTN_DOWN:
|
|
|
|
lcdPrint("MSC active");
|
|
|
|
lcdRefresh();
|
|
|
|
usbMSCInit();
|
|
|
|
while(1);
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
|
2011-12-17 21:32:49 +00:00
|
|
|
fsInit();
|
2011-05-11 21:24:05 +00:00
|
|
|
|
2011-12-23 12:22:13 +00:00
|
|
|
if( getInputRaw() == BTN_UP ){ // Reset config
|
|
|
|
saveConfig();
|
|
|
|
}
|
|
|
|
|
2011-05-21 10:05:48 +00:00
|
|
|
wrapper(); // see module/ subdirectory
|
2011-05-11 21:24:05 +00:00
|
|
|
}
|
2011-12-25 19:15:42 +00:00
|
|
|
|
|
|
|
int getrelease(void){
|
2012-01-04 15:31:46 +00:00
|
|
|
return 0x00000109;
|
2011-12-25 19:15:42 +00:00
|
|
|
};
|