/* * \brief Main entry point of Arduino application */ extern "C" void vm_main( void ) { VM_THREAD_HANDLE handle; /* Alloc DMA memory for SPI read and write, for SPI must be use non-cache memory, so we need use vm_malloc_dma to alloc memory, but in arduino thread we cannot invoke this interface directly, so use here to prepare memory, you can see its usage in SPI.transfer in SPI.cpp */ spi_w_data = (unsigned char*)vm_malloc_dma(2); spi_r_data = (unsigned char*)vm_malloc_dma(2); /* Same reason like above, this is used for transferring large of data, like screen buffer, you can see its usage in SPI.write in SPI.cpp */ spi_data_memory = (unsigned char*)vm_malloc_dma(64*1024); memset(spi_data_memory,0, 64*1024); /* only prepare something for rand, please don't delete this , otherwise arduino cannot use these two interface */ srand(0) ; rand(); /* Register system event callback */ vm_pmng_register_system_event_callback(__handle_sysevt); /* Register voice call event callback */ vm_gsm_tel_call_reg_listener(__call_listener_func); /* Create arduino thread, and change its priority, please don't change the code, or it will effort system stable */ handle = vm_thread_create(__arduino_thread, NULL, 0); vm_thread_change_priority(handle, 245); }
/* Entry point */ void vm_main(void) { #if defined(__HDK_LINKIT_ASSIST_2502__) lcd_st7789s_init(); lcd_backlight_level(60); #endif vm_pmng_register_system_event_callback(handle_sysevt); }
/* Entry point */ void vm_main(void) { retarget_setup(); fputs("hello, linkit assist\n", stdout); /* register system events handler */ vm_pmng_register_system_event_callback(handle_sysevt); }
void vm_main(void) { /* register system events handler */ vm_pmng_register_system_event_callback(handle_sysevt); }
void vm_main(void) { vm_pmng_register_system_event_callback(handle_sysevt); }