Skip to content

Commit

Permalink
Merge branch 'master' of https://gitee.com/openLuat/LuatOS
Browse files Browse the repository at this point in the history
  • Loading branch information
allewalker committed Oct 31, 2023
2 parents 0b61d8b + 3620b54 commit 8718947
Show file tree
Hide file tree
Showing 8 changed files with 2,662 additions and 12 deletions.
17 changes: 8 additions & 9 deletions components/u8g2/luat_lib_u8g2.c
Expand Up @@ -1327,18 +1327,15 @@ uint8_t u8x8_luat_gpio_and_delay_default(u8x8_t *u8x8, uint8_t msg, uint8_t arg_
switch(msg)
{
case U8X8_MSG_DELAY_NANO: // delay arg_int * 1 nano second
__asm__ volatile("nop");
luat_timer_us_delay(1);
break;

case U8X8_MSG_DELAY_100NANO: // delay arg_int * 100 nano seconds
__asm__ volatile("nop");
luat_timer_us_delay(1);
break;

case U8X8_MSG_DELAY_10MICRO: // delay arg_int * 10 micro seconds
for (uint16_t n = 0; n < 320; n++)
{
__asm__ volatile("nop");
}
luat_timer_us_delay(1);
break;

case U8X8_MSG_DELAY_MILLI: // delay arg_int * 1 milli second
Expand Down Expand Up @@ -1404,9 +1401,11 @@ uint8_t u8x8_luat_gpio_and_delay_default(u8x8_t *u8x8, uint8_t msg, uint8_t arg_
case U8X8_MSG_DELAY_I2C:
// arg_int is the I2C speed in 100KHz, e.g. 4 = 400 KHz
// arg_int=1: delay by 5us, arg_int = 4: delay by 1.25us
for (uint16_t n = 0; n < (arg_int<=2?160:40); n++)
{
__asm__ volatile("nop");
if (arg_int<=2) {
luat_timer_us_delay(5);
}
else {
luat_timer_us_delay(2);
}
break;

Expand Down
11 changes: 11 additions & 0 deletions components/u8g2/u8g2_font_opposansm.c
Expand Up @@ -2,6 +2,7 @@
u8g2_fonts.c
*/
#include "u8g2.h"
#include "luat_conf_bsp.h"
/*
Fontname: -FreeType-OPPOSans M-Medium-R-Normal--11-80-100-100-P-103-ISO10646-1
Copyright: copyright c 2019 by OPPO. All rights reserved.
Expand Down Expand Up @@ -37136,6 +37137,7 @@ const uint8_t u8g2_font_opposansm16_chinese[450103] U8G2_FONT_SECTION("u8g2_font
BBX Build Mode: 0
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_OPPOSANSM18_CHINESE
const uint8_t u8g2_font_opposansm18_chinese[517158] U8G2_FONT_SECTION("u8g2_font_opposansm18_chinese") =
"\312\0\4\3\5\5\5\5\6\33\37\377\370\22\371\24\374\3^\6\377\12\5 \6\0@x\2!\15\203"
"Jg\302\7\22:Ij\21\1\42\24(\311\275\206\214\204\310\204\210'\22#\22\62\22\62\22\0#\61"
Expand Down Expand Up @@ -53299,6 +53301,7 @@ const uint8_t u8g2_font_opposansm18_chinese[517158] U8G2_FONT_SECTION("u8g2_font
"\304<\300\314\60\25\341\301\301L\305\1E\205<\210\214E\205\221E\205\221\210DL\204\210\220\210DL"
"\204\210\220E\205=\360\301A\321\301A\221\32!m\204\204\16\16\212\16\16\212\324\10i#\244\215D\221"
"\32\11\32\0\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */
/*
Fontname: -FreeType-OPPOSans M-Medium-R-Normal--28-200-100-100-P-253-ISO10646-1
Expand All @@ -53307,6 +53310,7 @@ const uint8_t u8g2_font_opposansm18_chinese[517158] U8G2_FONT_SECTION("u8g2_font
BBX Build Mode: 0
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_OPPOSANSM20_CHINESE
const uint8_t u8g2_font_opposansm20_chinese[599047] U8G2_FONT_SECTION("u8g2_font_opposansm20_chinese") =
"\312\0\4\4\5\6\5\6\6\37\42\376\370\25\370\26\373\3\313\10\6\13\243 \6\0\200 \12!\21\344"
"\222\336\11#\346'\362\347AF\220\20\1\0\42\30)\221m\33CF\14\31!f\204\230\21b\254\21"
Expand Down Expand Up @@ -72029,6 +72033,7 @@ const uint8_t u8g2_font_opposansm20_chinese[599047] U8G2_FONT_SECTION("u8g2_font
"\36\0\31\322\304H>\30T\342\301y $\302\203\13b\305\31\61A\244\20#M\20)\304H\23D"
"\12\61b\214\230\70\17\313\7\245\36\224\22$+A\262zP\352A)A\262\22$+AR\224\22$"
"E)\321\301\0\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */
/*
Fontname: -FreeType-OPPOSans M-Medium-R-Normal--30-220-100-100-P-277-ISO10646-1
Expand All @@ -72037,6 +72042,7 @@ const uint8_t u8g2_font_opposansm20_chinese[599047] U8G2_FONT_SECTION("u8g2_font
BBX Build Mode: 0
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_OPPOSANSM22_CHINESE
const uint8_t u8g2_font_opposansm22_chinese[680313] U8G2_FONT_SECTION("u8g2_font_opposansm22_chinese") =
"\312\0\4\4\5\6\6\6\7\42%\376\367\27\367\31\373\4!\10\356\14\217 \6\0\0A$!\20$"
"\23=$\260\230_\10\221\237\213@\61\0\42\36J\21]g\214\31\61f\304\230\21cF\214\31\61f"
Expand Down Expand Up @@ -93298,6 +93304,7 @@ const uint8_t u8g2_font_opposansm22_chinese[680313] U8G2_FONT_SECTION("u8g2_font
"V\266d\261\7#\212\30aSb<\260\61FN\234\62r\342\224\20iD\210\21%D\32\21bD"
"\11\221F\204\30QFN\234\207\213\7\307\36\34\33$h\220\260A\202\6\11\33$h\220\260\7\307\36"
"\34\33$h\220\260A\202\6\11\33$hD\261A\202F\24\33N\10\0\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */

/*
Expand All @@ -93307,6 +93314,7 @@ const uint8_t u8g2_font_opposansm22_chinese[680313] U8G2_FONT_SECTION("u8g2_font
BBX Build Mode: 0
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_OPPOSANSM24_CHINESE
const uint8_t u8g2_font_opposansm24_chinese[755731] U8G2_FONT_SECTION("u8g2_font_opposansm24_chinese") =
"\312\0\4\4\6\6\6\6\7$)\376\366\31\366\33\372\4\233\12\14\15\354 \6\0\0\202I!\20\305"
"&z\311\30\62\377\377=\270!)F\0\42\27\312\62\276\317\30\63b\314\31C\326\134\63b\314\210\61"
Expand Down Expand Up @@ -116925,6 +116933,7 @@ const uint8_t u8g2_font_opposansm24_chinese[755731] U8G2_FONT_SECTION("u8g2_font
"\242X\341\222\346\36\250\61\322d=\260\363@\305\34\271\352\310Ub\204\210\21\42F\224\30!b\204\210"
"\21u\344\252#W\35\271\36\262\7\311\36${\220L\224T\303DI\65\354A\262\7\311\36$\23%"
"\325\60QR\15\23%\21\61Q\222\30\23\17\242\20\0\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */
/*
Fontname: -FreeType-OPPOSans M-Medium-R-Normal--44-320-100-100-P-402-ISO10646-1
Expand All @@ -116933,6 +116942,7 @@ const uint8_t u8g2_font_opposansm24_chinese[755731] U8G2_FONT_SECTION("u8g2_font
BBX Build Mode: 0
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_OPPOSANSM32_CHINESE
const uint8_t u8g2_font_opposansm32_chinese[1107201] U8G2_FONT_SECTION("u8g2_font_opposansm32_chinese") =
"\312\0\4\4\6\6\6\6\7\61\66\375\363!\363$\371\7R\20\343\26\364 \6\0\0\202M!\27\6"
"\71vL\60Q\202\10\375\377\337\214\21\17U\30\22\17F\220\0\42)\317\63\322U!T\204P\21B"
Expand Down Expand Up @@ -151535,4 +151545,5 @@ const uint8_t u8g2_font_opposansm32_chinese[1107201] U8G2_FONT_SECTION("u8g2_fon
"\310\7\17D\22\33Fl$\261a\304F\22\33Fl\344\203\7\42\37<\20\371\340\201Hb\303\210\215"
"$\66\214\330Hb\303\210\215$\66\214\330Hb\303H\240$\66\214\310I\362\300\214\222\7\66\22\0\0"
"";
#endif
#endif /* U8G2_USE_LARGE_FONTS */
13 changes: 13 additions & 0 deletions components/u8g2/u8g2_font_sarasa.c
Expand Up @@ -2,6 +2,7 @@
u8g2_fonts.c
*/
#include "u8g2.h"
#include "luat_conf_bsp.h"
/*
Fontname: -FreeType-Sarasa Mono SC Nerd-Medium-R-Normal--11-80-100-100-P-99-ISO10646-1
Copyright: Copyright 2015-2020, Renzhi Li (a.k.a. Belleve Invis, belleve@typeof.net). Portions Copyright © 2014-2019 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. Portions Copyright 2017-2020 Rasmus Andersson. Portions Copyright 2017, 2018 MoneMizuno.
Expand Down Expand Up @@ -52022,6 +52023,7 @@ const uint8_t u8g2_font_sarasa_m16_chinese[454557] U8G2_FONT_SECTION("u8g2_font_
BBX Build Mode: 2
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_SARASA_M18_CHINESE
const uint8_t u8g2_font_sarasa_m18_chinese[547394] U8G2_FONT_SECTION("u8g2_font_sarasa_m18_chinese") =
"\312\2\4\3\5\5\1\4\6\31\33\0\373\23\373\25\374\5\323\14\334\22\366 \14y\237\374\361\377\377\377"
"\377\377\0!)y\237\374\361J\36P\36P\36P\36P\36P\36P\36P\36P\36P\36P\36P"
Expand Down Expand Up @@ -69130,6 +69132,7 @@ const uint8_t u8g2_font_sarasa_m18_chinese[547394] U8G2_FONT_SECTION("u8g2_font_
"\225\34\210\324\304\3\311#\250\250\260\13\221\210\211\20\221\13\221\210\211\20\221\253\250\260Grp@wp"
"@\27$#$\27$#$wp@\27$#$\27$#$\27$#\21\42\27$#\62\217G\0"
"\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */

/*
Expand All @@ -69139,6 +69142,7 @@ const uint8_t u8g2_font_sarasa_m18_chinese[547394] U8G2_FONT_SECTION("u8g2_font_
BBX Build Mode: 2
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_SARASA_M20_CHINESE
const uint8_t u8g2_font_sarasa_m20_chinese[634161] U8G2_FONT_SECTION("u8g2_font_sarasa_m20_chinese") =
"\312\2\4\2\5\5\1\4\6\34\36\0\372\25\372\30\373\6M\15\202\23\312 \15\334\27\376\371\377\377\377"
"\377\377\377\3!)\334\27\376\371@\217\325c\365X=V\217\325c\365X=V\217\325c\365X=V"
Expand Down Expand Up @@ -88958,6 +88962,7 @@ const uint8_t u8g2_font_sarasa_m20_chinese[634161] U8G2_FONT_SECTION("u8g2_font_
"p\240\307M\366\230Ah\20\37\4\7\302\201b\360\223\201fp\240\31d\362\300<\315`\61X\14\206"
"\22\205D\241\11J\24\22\205&\70X\14\26\203=\331\340\7\302\301\17\204\42\207\42\207\42\207\203\37\10"
"\7\77\20\212\34\212\34\212\34\212L\6y~\13\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */

/*
Expand All @@ -88967,6 +88972,7 @@ const uint8_t u8g2_font_sarasa_m20_chinese[634161] U8G2_FONT_SECTION("u8g2_font_
BBX Build Mode: 2
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_SARASA_M22_CHINESE
const uint8_t u8g2_font_sarasa_m22_chinese[720275] U8G2_FONT_SECTION("u8g2_font_sarasa_m22_chinese") =
"\312\2\4\2\5\6\1\4\6\37\42\0\371\27\372\32\373\7\22\17\33\26S \20_\34\377\363\377\377\377"
"\377\377\377\377\377\21\0!._\34\377\363\267z\270\36\256\207\353\341z\270\36\256\207\353\341z\270\36\256"
Expand Down Expand Up @@ -111477,6 +111483,7 @@ const uint8_t u8g2_font_sarasa_m22_chinese[720275] U8G2_FONT_SECTION("u8g2_font_
"h\6\17\62\3M\36\232\247\33\14\22\203Ab\60\10j\24\32\205F\250Qh\24\32\241F\241Qh"
"\204\203Ab\60H\14\6yN\7\177 \34\374\201p\244\62\34\251\14G*\303\301\37\10\7\177 \34"
"\251\14G*\303\221J\222\30\216T\222Ar\317\277\6\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */

/*
Expand All @@ -111486,6 +111493,7 @@ const uint8_t u8g2_font_sarasa_m22_chinese[720275] U8G2_FONT_SECTION("u8g2_font_
BBX Build Mode: 2
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_SARASA_M24_CHINESE
const uint8_t u8g2_font_sarasa_m24_chinese[787293] U8G2_FONT_SECTION("u8g2_font_sarasa_m24_chinese") =
"\312\2\4\2\6\6\1\4\7!$\0\371\31\371\34\373\7\330\20\245\30\236 \21!\71\302\317\377\377\377"
"\377\377\377\377\377\377o\0!\65!\71\302\317\77\332\23\354\11\366\4{\202=\301\236`O\260'\330\23"
Expand Down Expand Up @@ -136090,6 +136098,7 @@ const uint8_t u8g2_font_sarasa_m24_chinese[787293] U8G2_FONT_SECTION("u8g2_font_
"\314\7\313\301 \70X\14\36$\6\3\311`\63x\220\31\210\364\330<\351`\62\30D\6\323\301d\60"
"\210\14\246\232\210F\22\212\16&\203Ad\60\35L\6\203\310`\317\213\301\277\34\374K\225\325Re\265"
"TY-\7\377r\360/UVK\225\325Re\265T\231\14\226*\223\201T\317\177\10\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */

/*
Expand All @@ -136099,6 +136108,7 @@ const uint8_t u8g2_font_sarasa_m24_chinese[787293] U8G2_FONT_SECTION("u8g2_font_
BBX Build Mode: 2
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_SARASA_M26_CHINESE
const uint8_t u8g2_font_sarasa_m26_chinese[909397] U8G2_FONT_SECTION("u8g2_font_sarasa_m26_chinese") =
"*\2\4\3\6\6\1\4\7$+\0\370\32\371\36\372\10\270\22\254\71\215 \24\344\32\310\217\377\377\377"
"\377\377\377\377\377\377\377\377\377\337\0!<\344\32\310\217\377\377O\344\21\311#\222G$\217H\36\221<"
Expand Down Expand Up @@ -164519,6 +164529,7 @@ const uint8_t u8g2_font_sarasa_m26_chinese[909397] U8G2_FONT_SECTION("u8g2_font_
"\363\300\362\250O\16BNO\16BNeD\204DdDeD\204DdDeD\204DdDO\16"
"BNO\16B\356\361\356\340A\351\301\203\322)\61\245SbJ\247\304\224\36<(=xP:%\246"
"tJL\351\224\230\322)\61\21\323)\61\31\332y\374\277\6\0";
#endif
#endif /* U8G2_USE_LARGE_FONTS */

/*
Expand All @@ -164528,6 +164539,7 @@ const uint8_t u8g2_font_sarasa_m26_chinese[909397] U8G2_FONT_SECTION("u8g2_font_
BBX Build Mode: 2
*/
#ifdef U8G2_USE_LARGE_FONTS
#ifdef USE_U8G2_SARASA_M28_CHINESE
const uint8_t u8g2_font_sarasa_m28_chinese[973857] U8G2_FONT_SECTION("u8g2_font_sarasa_m28_chinese") =
"\312\2\4\3\6\6\1\4\7')\0\370\35\370!\372\11T\23\315\35\27 \25g\32\316\217\377\377\377"
"\377\377\377\377\377\377\377\377\377\377\22\0!@g\32\316\217\377|\36\331<\262yd\363\310\346\221\315#"
Expand Down Expand Up @@ -194963,6 +194975,7 @@ const uint8_t u8g2_font_sarasa_m28_chinese[973857] U8G2_FONT_SECTION("u8g2_font_
"\17\42\16D\16b\17\42\16D\16\342\361\374\340\333\203o\305\246\306f\305\246\306f\305\246\306f\305\246"
"\306f\17\276=\370VljlVljlVljlVlj\344Vlj\246X\36\377\277\0\0"
"";
#endif
#endif /* U8G2_USE_LARGE_FONTS */


6 changes: 6 additions & 0 deletions demo/bit64/main.lua
Expand Up @@ -86,6 +86,12 @@ if bit64 then
log.info("0xc000000000*2=", bit64.show(bit64.multi(a,b), 16))
log.info("0xc000000000/2=", bit64.show(bit64.pide(a,b), 16))
log.style(0)

if bit64.strtoll then
local data = bit64.strtoll("864040064024194", 10)
log.info("data", data:toHex())
log.info("data", bit64.show(data))
end
end

local function sys_run_time()
Expand Down
2 changes: 1 addition & 1 deletion luat/include/luat_pwm.h
Expand Up @@ -16,5 +16,5 @@ int luat_pwm_open(int channel, size_t period, size_t pulse, int pnum);
int luat_pwm_setup(luat_pwm_conf_t* conf);
int luat_pwm_capture(int channel,int freq);
int luat_pwm_close(int channel);

int luat_pwm_update_dutycycle(int channel, size_t pulse);
#endif
5 changes: 5 additions & 0 deletions luat/vfs/luat_fs_inline.c
Expand Up @@ -19,12 +19,16 @@ extern const luadb_file_t luat_inline2_libs_64bit_size32[];
#else
extern const luadb_file_t luat_inline2_libs[];
#endif
extern const luadb_file_t luat_inline2_libs_source[];

#ifdef LUAT_USE_FS_VFS

FILE* luat_vfs_inline_fopen(void* userdata, const char *filename, const char *mode) {
//LLOGD("open inline %s", filename);
luadb_file_t* file = NULL;
#ifdef LUAT_CONF_USE_LIBSYS_SOURCE
file = luat_inline2_libs_source;
#else
#ifdef LUAT_CONF_VM_64bit
#if defined(LUA_USE_LINUX) || (defined(LUA_USE_WINDOWS) && defined(__XMAKE_BUILD__))
file = luat_inline2_libs_64bit_size64;
Expand All @@ -33,6 +37,7 @@ FILE* luat_vfs_inline_fopen(void* userdata, const char *filename, const char *mo
#endif
#else
file = luat_inline2_libs;
#endif
#endif

if (!strcmp("r", mode) || !strcmp("rb", mode)) {
Expand Down

0 comments on commit 8718947

Please sign in to comment.