From 13b35611e23df582ab86b8ae0ba95ccf33ae562f Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Mon, 27 Jul 2020 22:15:42 +0100 Subject: [PATCH] boards: p8: Full support for Colmi P8 All the components (bootloader, reloader, micropython) has P8 support added some time back but without full integration at the wasp-os level. Let's add it! Signed-off-by: Daniel Thompson --- bootloader | 2 +- micropython | 2 +- reloader | 2 +- res/p8dfu.png | Bin 9521 -> 15149 bytes wasp/boards/p8/manifest.py | 45 +++++++++++++ wasp/boards/p8/watch.py.in | 132 +++++++++++++++++++++++++++++++++++++ 6 files changed, 180 insertions(+), 3 deletions(-) create mode 100644 wasp/boards/p8/manifest.py create mode 100644 wasp/boards/p8/watch.py.in diff --git a/bootloader b/bootloader index 85a9b76..89ba9a8 160000 --- a/bootloader +++ b/bootloader @@ -1 +1 @@ -Subproject commit 85a9b76d8451eba2e2c9e5d9b3b1b8450178105f +Subproject commit 89ba9a874fa052ae7b0df8a9b6a6f8916309cd29 diff --git a/micropython b/micropython index 89f48ac..c7cf47a 160000 --- a/micropython +++ b/micropython @@ -1 +1 @@ -Subproject commit 89f48aca20920073d0c88782df0a8881651a5b28 +Subproject commit c7cf47a3681ab1625b52b7b8663bfa95dd5d9096 diff --git a/reloader b/reloader index 2888b28..b4512e5 160000 --- a/reloader +++ b/reloader @@ -1 +1 @@ -Subproject commit 2888b288763a1a612b9d9aa2554b5d2901c2be12 +Subproject commit b4512e5d92d062a65a216d68bffcdc03ff1625cf diff --git a/res/p8dfu.png b/res/p8dfu.png index a5dcfd0589ba688ac7045fc3d028153163c217a3..c997190da5d300454ceb39f0416f9ec184e0575f 100644 GIT binary patch delta 10555 zcmY*;WlS6lut^78U#eoSUE zIhi?`RGm&;`}1JH+Tmesn>Kx^}99W#$U271x-_(09PrJ34x(@aNy%)pvqV{j=qx z1wUYm-^Wp+Y|h)<`^m2VZpiG->#KL~$Iy+K$W6~DEvuYGppp6Ct_1|D8nC~A$2Fc+YDi|Xm1~#b8nrhKaIU-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{js>o`6V>x`vEz zvR$&3B>X2)Oj=3W`}p*Wp3-TSp@@ywogL?`!9*7fROPwW8*i%3RV8yCHntfT1AnO$ zPFNCXRoP&>KJT-`F&FJ`lRx--6>Ns?Pdzd@;=m8VJLEw}I#%GnKQ#vKoN_re1)!&(F|w6?k< zju<`L@JVHN-Z4uUyeaR|$61-$&hzf=<(>Y#bvC~^yn~-oTyG%O+s76A(Y(XD@rI{W(omm=nN{)KFG1`sYEh{MDO9@S(iI z;@aJv<3u9ur<3Y;-^#{?VYC4z>B^rc_F|K8x#q!XNrZ+=K_r#r2DlAsaX)v7XX+V+%D!!Xxq$7oTH3PJr&a91MzZTI z(1A@p*vvW@U~N#OfR-~Yx<~8EibjbnXRA&fswTz4w&N+rMuj>raaN>W^epUnt&$+^ zI8Ro`Y&3~22(lb6=NF1^P4e8u*ghr)DqRV0(Hp^41I>&A z)z=ZK(}vn}&AE(sU8=0ZlwQD|l=%c;vfb9$ZSZSsYF|2!LPTsOh+aZ|np6UpT*wwA zsZqNp^C!gP`o|#cqqjdQu+z<8R9*MmGapQnnhBreGEltJwy;d%re%t8B3j^)+#E^U z86{~qU)qw9_Gme7Z)?2+{p;C(vU%dA8vCt!rWQ2$tW7w4Yj+WlHbRA$e<>BzMTK)1 zqhzxpHfnzMB{RCUg;I(%=!nUZJ`xGj`7F0cA@W?uU!t<*DVsy`cf=Sxio*f9uQFZg zV)0+Fz!%*f5G3XjOw>X_xkga@|F8SMYv6xV|1#4n>raak4Mq_mV=Qp@)x)57%}Vg ziL1Qjh%ee{Tk{$1<2BtwLTzk566h4JiNA*_pz3!Bp>kGkYQCsEL+|C#VyfH%t!6{A zBatUwwoOGED$|imfGa0_-@->9r7N+Wb~HBOGJ!IIOMU~N_W_CF= 3: + hi = 0 + elif level == 2: + mid = 0 + elif level == 1: + lo = 0 + + self.hi(hi) + self.mid(mid) + self.lo(lo) + +# Setup the display (and manage the backlight) +backlight = Backlight(0) +spi = SPI(0) +spi.init(polarity=1, phase=1, baudrate=8000000) +display = ST7789_SPI(240, 240, spi, + cs=Pin("DISP_CS", Pin.OUT), + dc=Pin("DISP_DC", Pin.OUT), + res=Pin("DISP_RST", Pin.OUT)) +drawable = draw565.Draw565(display) + +def boot_msg(s): + drawable.string(s, 0, 108, width=240) + if safe_mode: + time.sleep_ms(500) + +safe_mode = False +boot_msg("Init button") +button = Pin('BUTTON', Pin.IN) +safe_mode = button.value() +if safe_mode: + backlight.set(1) + time.sleep(1) + +try: + # Setup the last few bits and pieces + boot_msg("Init hardware") + usb_pwr = Signal(Pin('USB_PWR', Pin.IN), invert=True) + battery = Battery(Pin('BATTERY', Pin.IN), usb_pwr, usb_pwr) + i2c = I2C(1, scl='I2C_SCL', sda='I2C_SDA') + accel = BMA421(i2c) + hrs = HRS3300(i2c) + touch = CST816S(i2c, + Pin('TP_INT', Pin.IN), Pin('TP_RST', Pin.OUT, value=0), + _callback) + vibrator = Vibrator(Pin('MOTOR', Pin.OUT, value=0), active_low=True) + + # Release flash from deep power-down + boot_msg("Wake SPINOR") + nor_cs = Pin('NOR_CS', Pin.OUT, value=1) + nor_cs(0) + spi.write('\xAB') + nor_cs(1) + + # Mount the filesystem + boot_msg("Init SPINOR") + flash = FLASH(spi, (nor_cs,)) + try: + boot_msg("Mount FS") + os.mount(flash, '/flash') + except AttributeError: + # Format the filesystem (and provide a default version of main.py) + boot_msg("Format FS") + os.VfsLfs2.mkfs(flash) + boot_msg("Retry mount FS") + os.mount(flash,'/flash') + boot_msg("Write main.py") + with open('/flash/main.py', 'w') as f: + f.write('''\ +#include('main.py') +''') + + # Only change directory if the button is not pressed (this will + # allow us access to fix any problems with main.py)! + if not safe_mode: + boot_msg("Enter /flash") + os.chdir('/flash') + boot_msg("Run main.py") + else: + boot_msg("Safe mode") +except: + drawable.string("FAILED", 0, 136, width=240) + backlight.set(1)