@@ -221,33 +221,16 @@ void rt_application_init(void);
221
221
void rt_hw_board_init (void );
222
222
int rtthread_startup (void );
223
223
224
- #if defined(__ARMCC_VERSION )
225
- extern int $Super$$main (void );
226
- /* re-define main function */
227
- int $Sub$$main (void )
228
- {
229
- rtthread_startup ();
230
- return 0 ;
231
- }
232
- #elif defined(__ICCARM__ )
233
- extern int main (void );
234
- /* __low_level_init will auto called by IAR cstartup */
235
- extern void __iar_data_init3 (void );
236
- int __low_level_init (void )
237
- {
238
- // call IAR table copy function.
239
- __iar_data_init3 ();
240
- rtthread_startup ();
241
- return 0 ;
242
- }
243
- #elif defined(__GNUC__ )
244
- /* Add -eentry to arm-none-eabi-gcc argument */
245
- int entry (void )
224
+ /* system entry */
225
+ extern int rtthread_startup (void );
226
+ int wmain (int argc , char * argv [])
246
227
{
228
+ /* disable interrupt first */
229
+ rt_hw_interrupt_disable ();
230
+ /* startup RT-Thread RTOS */
247
231
rtthread_startup ();
248
- return 0 ;
249
232
}
250
- #endif
233
+ #pragma comment(linker, "/subsystem:console /entry:wmainCRTStartup")
251
234
252
235
#ifndef RT_USING_HEAP
253
236
/* if there is not enable heap, we should use static thread and stack. */
@@ -269,15 +252,9 @@ void main_thread_entry(void *parameter)
269
252
#ifdef RT_USING_SMP
270
253
rt_hw_secondary_cpu_up ();
271
254
#endif
255
+
272
256
/* invoke system main function */
273
- #if defined(__ARMCC_VERSION )
274
- {
275
- extern int $Super$$main (void );
276
- $Super$$main (); /* for ARMCC. */
277
- }
278
- #elif defined(__ICCARM__ ) || defined(__GNUC__ ) || defined(__TASKING__ ) || defined(_MSC_VER )
279
257
main ();
280
- #endif
281
258
}
282
259
283
260
void rt_application_init (void )
0 commit comments