| Index: platforms/stm/event_handler_test/src/dartino_entry.cc
|
| diff --git a/platforms/stm/event_handler_test/src/fletch_entry.cc b/platforms/stm/event_handler_test/src/dartino_entry.cc
|
| similarity index 70%
|
| rename from platforms/stm/event_handler_test/src/fletch_entry.cc
|
| rename to platforms/stm/event_handler_test/src/dartino_entry.cc
|
| index 127464472f2501742ba9bd88feae868e36f6720f..ccd20794d5a39f1ea510dd90c2853bcb2feb0dd7 100644
|
| --- a/platforms/stm/event_handler_test/src/fletch_entry.cc
|
| +++ b/platforms/stm/event_handler_test/src/dartino_entry.cc
|
| @@ -11,12 +11,12 @@ extern "C" {
|
| #include <stm32746g_discovery.h>
|
| #include <stm32746g_discovery_lcd.h>
|
|
|
| -#include "include/fletch_api.h"
|
| +#include "include/dartino_api.h"
|
| #include "include/static_ffi.h"
|
|
|
| -#include "platforms/stm/disco_fletch/src/fletch_entry.h"
|
| -#include "platforms/stm/disco_fletch/src/page_allocator.h"
|
| -#include "platforms/stm/disco_fletch/src/uart.h"
|
| +#include "platforms/stm/disco_dartino/src/dartino_entry.h"
|
| +#include "platforms/stm/disco_dartino/src/page_allocator.h"
|
| +#include "platforms/stm/disco_dartino/src/uart.h"
|
| #include "src/shared/platform.h"
|
| #include "src/shared/utils.h"
|
|
|
| @@ -36,9 +36,9 @@ static void MessageQueueProducer(const void *argument) {
|
| for (;;) {
|
| counter++;
|
| int port_id = 1;
|
| - int status = fletch::SendMessageCmsis(port_id, counter);
|
| + int status = dartino::SendMessageCmsis(port_id, counter);
|
| if (status != osOK) {
|
| - fletch::Print::Error("Error Sending %d\n", status);
|
| + dartino::Print::Error("Error Sending %d\n", status);
|
| }
|
| osDelay(kMessageFrequency);
|
| }
|
| @@ -49,31 +49,31 @@ static void MessageQueueProducer(const void *argument) {
|
| extern "C" int Write(int file, char *ptr, int len) {
|
| for (int i = 0; i < len; i++) {
|
| if (file == 2) {
|
| - fletch::Print::Error("%c", *ptr++);
|
| + dartino::Print::Error("%c", *ptr++);
|
| } else {
|
| - fletch::Print::Out("%c", *ptr++);
|
| + dartino::Print::Out("%c", *ptr++);
|
| }
|
| }
|
| return len;
|
| }
|
|
|
| -FLETCH_EXPORT_TABLE_BEGIN
|
| - FLETCH_EXPORT_TABLE_ENTRY("BSP_LED_On", BSP_LED_On)
|
| - FLETCH_EXPORT_TABLE_ENTRY("BSP_LED_Off", BSP_LED_Off)
|
| -FLETCH_EXPORT_TABLE_END
|
| +DARTINO_EXPORT_TABLE_BEGIN
|
| + DARTINO_EXPORT_TABLE_ENTRY("BSP_LED_On", BSP_LED_On)
|
| + DARTINO_EXPORT_TABLE_ENTRY("BSP_LED_Off", BSP_LED_Off)
|
| +DARTINO_EXPORT_TABLE_END
|
|
|
| -// Run fletch on the linked in snapshot.
|
| -void StartFletch(void const * argument) {
|
| - fletch::Print::Out("Setup fletch\n");
|
| - FletchSetup();
|
| - fletch::Print::Out("Read fletch snapshot\n");
|
| +// Run dartino on the linked in snapshot.
|
| +void StartDartino(void const * argument) {
|
| + dartino::Print::Out("Setup dartino\n");
|
| + DartinoSetup();
|
| + dartino::Print::Out("Read dartino snapshot\n");
|
| unsigned char *snapshot = &_binary_event_handler_test_snapshot_start;
|
| int snapshot_size =
|
| reinterpret_cast<int>(&_binary_event_handler_test_snapshot_size);
|
| - FletchProgram program = FletchLoadSnapshot(snapshot, snapshot_size);
|
| - fletch::Print::Out("Run fletch program\n");
|
| - FletchRunMain(program);
|
| - fletch::Print::Out("Fletch program exited\n");
|
| + DartinoProgram program = DartinoLoadSnapshot(snapshot, snapshot_size);
|
| + dartino::Print::Out("Run dartino program\n");
|
| + DartinoRunMain(program);
|
| + dartino::Print::Out("Dartino program exited\n");
|
| }
|
|
|
| // LCDLogPutchar is defined by the STM LCD log utility
|
| @@ -93,7 +93,7 @@ void LCDPrintIntercepter(const char* message, int out, void* data) {
|
| }
|
|
|
| // Main entry point from FreeRTOS. Running in the default task.
|
| -void FletchEntry(void const * argument) {
|
| +void DartinoEntry(void const * argument) {
|
| // Add an arena of the 8Mb of external memory.
|
| uint32_t ext_mem_arena =
|
| page_allocator->AddArena("ExtMem", 0xc0000000, 0x800000);
|
| @@ -108,19 +108,19 @@ void FletchEntry(void const * argument) {
|
| BSP_LCD_SelectLayer(1);
|
| BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
|
|
|
| - fletch::Platform::Setup();
|
| + dartino::Platform::Setup();
|
|
|
| // Initialize LCD Log module.
|
| LCD_LOG_Init();
|
| - LCD_LOG_SetHeader(reinterpret_cast<uint8_t*>(const_cast<char*>("Fletch")));
|
| + LCD_LOG_SetHeader(reinterpret_cast<uint8_t*>(const_cast<char*>("Dartino")));
|
| LCD_LOG_SetFooter(reinterpret_cast<uint8_t*>(const_cast<char*>(
|
| "STM32746G-Discovery")));
|
| - FletchRegisterPrintInterceptor(LCDPrintIntercepter, NULL);
|
| - fletch::Print::DisableStandardOutput();
|
| + DartinoRegisterPrintInterceptor(LCDPrintIntercepter, NULL);
|
| + dartino::Print::DisableStandardOutput();
|
|
|
| - osThreadDef(START_FLETCH, StartFletch, osPriorityNormal, 0,
|
| + osThreadDef(START_DARTINO, StartDartino, osPriorityNormal, 0,
|
| 3 * 1024 /* stack size */);
|
| - osThreadCreate(osThread(START_FLETCH), NULL);
|
| + osThreadCreate(osThread(START_DARTINO), NULL);
|
|
|
| osThreadDef(PRODUCER, MessageQueueProducer, osPriorityNormal, 0, 2 * 1024);
|
| osThreadCreate(osThread(PRODUCER), NULL);
|
|
|