diff options
Diffstat (limited to 'tools/osx/simulator-osx.c')
-rw-r--r-- | tools/osx/simulator-osx.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/osx/simulator-osx.c b/tools/osx/simulator-osx.c index 7298042..a1c446b 100644 --- a/tools/osx/simulator-osx.c +++ b/tools/osx/simulator-osx.c | |||
@@ -50,6 +50,10 @@ static MIDIEndpointRef g_inVirtualEndpoint = 0; | |||
50 | 50 | ||
51 | static const float TIMER_INTERVAL_S = 0.001; //s | 51 | static const float TIMER_INTERVAL_S = 0.001; //s |
52 | 52 | ||
53 | static const u16 g_ADC[PAD_COUNT]; | ||
54 | |||
55 | static u8 g_Flash[USER_AREA_SIZE]; | ||
56 | |||
53 | // ____________________________________________________________________________ | 57 | // ____________________________________________________________________________ |
54 | // | 58 | // |
55 | // Simulator "hal". This lets you exercise your device code without having to upload | 59 | // Simulator "hal". This lets you exercise your device code without having to upload |
@@ -95,6 +99,15 @@ void hal_send_sysex(u8 port, const u8* data, u16 length) | |||
95 | // as above, or just dump to console? | 99 | // as above, or just dump to console? |
96 | } | 100 | } |
97 | 101 | ||
102 | void hal_read_flash(u32 offset, u8 *data, u32 length) | ||
103 | { | ||
104 | memcpy(data, g_Flash+offset, length); | ||
105 | } | ||
106 | void hal_write_flash(u32 offset,const u8 *data, u32 length) | ||
107 | { | ||
108 | memcpy(g_Flash+offset, data, length); | ||
109 | } | ||
110 | |||
98 | ////////////////////////////////////////////////////////////////////////// | 111 | ////////////////////////////////////////////////////////////////////////// |
99 | static void processPacket(const unsigned char *data, int length) | 112 | static void processPacket(const unsigned char *data, int length) |
100 | { | 113 | { |
@@ -335,9 +348,13 @@ int main(int argc, char * argv[]) | |||
335 | // no Launchpad Pro connected | 348 | // no Launchpad Pro connected |
336 | return -3; | 349 | return -3; |
337 | } | 350 | } |
351 | |||
352 | // clear dummy flash & ADC | ||
353 | memset(g_Flash, 0, USER_AREA_SIZE); | ||
354 | memset(g_ADC, 0, sizeof(g_ADC)); | ||
338 | 355 | ||
339 | // now start things up | 356 | // now start things up |
340 | app_init(); | 357 | app_init(g_ADC); |
341 | 358 | ||
342 | // start a timer loop | 359 | // start a timer loop |
343 | CFRunLoopSourceContext source_context; | 360 | CFRunLoopSourceContext source_context; |
@@ -354,4 +371,4 @@ int main(int argc, char * argv[]) | |||
354 | CFRunLoopRun(); | 371 | CFRunLoopRun(); |
355 | 372 | ||
356 | return EXIT_SUCCESS; | 373 | return EXIT_SUCCESS; |
357 | } \ No newline at end of file | 374 | } |