Dozingfiretruck 5 лет назад
Родитель
Сommit
b85aace0ef

+ 2 - 1
bsp/air640w/rtt/SConstruct

@@ -8,7 +8,7 @@ else:
     RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
 
 # set RTT_ROOT
-if not os.getenv("RTT_ROOT"): 
+if not os.getenv("RTT_ROOT"):
     RTT_ROOT="rt-thread"
 
 sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
@@ -26,6 +26,7 @@ env = Environment(tools = ['mingw'],
     AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
     CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
     AR = rtconfig.AR, ARFLAGS = '-rc',
+    CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
     LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
 env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
 

+ 13 - 6
bsp/air640w/rtt/drivers/linker_scripts/link.lds

@@ -1,5 +1,5 @@
-/* Linker script to configure memory regions. 
- * Need modifying for a specific board. 
+/* Linker script to configure memory regions.
+ * Need modifying for a specific board.
  *   FLASH.ORIGIN: starting address of flash
  *   FLASH.LENGTH: length of flash
  *   RAM.ORIGIN: starting address of RAM bank 0
@@ -17,7 +17,7 @@ MEMORY
  * with other linker script that defines memory regions FLASH and RAM.
  * It references following symbols, which must be defined in code:
  *   Reset_Handler : Entry of reset handler
- * 
+ *
  * It defines following symbols, which code can use without definition:
  *   __exidx_start
  *   __exidx_end
@@ -61,7 +61,7 @@ SECTIONS
         *(.glue_7)
         *(.glue_7t)
         *(.gnu.linkonce.t*)
-        
+
         /* section information for finsh shell */
         . = ALIGN(4);
         __fsymtab_start = .;
@@ -79,6 +79,13 @@ SECTIONS
         KEEP(*(SORT(.rti_fn*)))
         __rt_init_end = .;
 
+        . = ALIGN(4);
+        PROVIDE(__ctors_start__ = .);
+        KEEP (*(SORT(.init_array.*)))
+        KEEP (*(.init_array))
+        PROVIDE(__ctors_end__ = .);
+
+
         . = ALIGN(4);
         __rtatcmdtab_start = .;
         KEEP(*(RtAtCmdTab))
@@ -108,7 +115,7 @@ SECTIONS
         KEEP(*(.eh_frame*))
     } > FLASH
 
-    .ARM.extab : 
+    .ARM.extab :
     {
         *(.ARM.extab* .gnu.linkonce.armextab.*)
     } > FLASH
@@ -180,7 +187,7 @@ SECTIONS
         *(COMMON)
         . = ALIGN(4);
         __bss_end__ = .;
-    } > RAM 
+    } > RAM
 
     ASSERT(__StackTop <= 0x20028000, "stack address error")
 }

+ 1 - 0
bsp/air640w/rtt/rtconfig.py

@@ -65,6 +65,7 @@ if PLATFORM == 'gcc':
     else:
         CFLAGS += ' -O2 -Wall'
 
+    CXXFLAGS = CFLAGS
     POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
     POST_ACTION += 'python ./makeimg.py'
 

+ 4 - 3
luat/modules/SConscript

@@ -7,9 +7,9 @@ src	= []
 for p in os.listdir(cwd) :
     if p.endswith(".c"):
         src += [p]
-CPPPATH = [cwd,  cwd + "/../include", 
-                 cwd + "/../packages/vsprintf", 
-                 cwd + "/../packages/minmea", 
+CPPPATH = [cwd,  cwd + "/../include",
+                 cwd + "/../packages/vsprintf",
+                 cwd + "/../packages/minmea",
                  cwd + "/../packages/lua-cjson",
                  ]
 
@@ -28,6 +28,7 @@ if not GetDepend(['RT_USING_ADC']):
     src.remove('luat_lib_adc.c')
 if not GetDepend(['PKG_USING_U8G2']):
     src.remove('luat_lib_disp.c')
+    src.remove('luat_lib_u8g2.c')
 
 src.remove('luat_shell.c')
 src.remove('luat_lib_lpmem.c')

+ 0 - 35
luat/modules/luat_lib_u8g2.c

@@ -286,41 +286,6 @@ static int l_u8g2_SetFontMode(lua_State *L){
 -- 设置为中文字体,对之后的drawStr有效,使用中文字体需在luat_base.h开启#define USE_U8G2_WQY12_T_GB2312
 u8g2.setFont("u8g2_font_wqy12_t_gb2312")
 */
-// static int l_u8g2_SetFont(lua_State *L) {
-//     if (u8g2 == NULL) {
-//         LLOGI("disp not init yet!!!");
-//         lua_pushboolean(L, 0);
-//         return 1;
-//     }
-//     size_t len;
-//     LLOGI("lua_type:%s",lua_type(L,1));
-
-//     const char* font = luaL_checklstring(L, 1, &len);
-//     if (strcmp("u8g2_font_ncenB08_tr", font) == 0) {
-//         u8g2_SetFont(u8g2, u8g2_font_ncenB08_tr);
-//         lua_pushboolean(L, 1);
-//         }
-// #if defined USE_U8G2_WQY12_T_GB2312
-//     else if (strcmp("u8g2_font_wqy12_t_gb2312", font) == 0) {
-//         u8g2_SetFont(u8g2, u8g2_font_wqy12_t_gb2312);
-//         lua_pushboolean(L, 1);
-//     }
-// #endif
-//     else if (strcmp("u8g2_font_unifont_t_symbols", font) == 0) {
-//         u8g2_SetFont(u8g2, u8g2_font_unifont_t_symbols);
-//         lua_pushboolean(L, 1);
-//     }
-// #if defined USE_U8G2_ICONIC_WEATHER_6X
-//     else if (strcmp("u8g2_font_open_iconic_weather_6x_t", font) == 0) {
-//         u8g2_SetFont(u8g2, u8g2_font_open_iconic_weather_6x_t);
-//         lua_pushboolean(L, 1);
-//     }
-// #endif
-//     else
-//         lua_pushboolean(L, 0);
-//     return 1;
-// }
-
 static int l_u8g2_SetFont(lua_State *L) {
     if (u8g2 == NULL) {
         LLOGI("disp not init yet!!!");