Skip to content

Commit

Permalink
Asynchronous Graphics Library (#2357)
Browse files Browse the repository at this point in the history
An asynchronous graphics management library intended for SPI-based displays.

On first use several required python modules must be installed. Try building a sample application:

```
cd $SMING_HOME
make fetch Graphics
cd Libraries/Graphics/samples/Basic_Graphics
make python-requirements
make
```

Currently only the ILI9341 display has a driver, but you can use the virtual screen for testing.
This is a display device for use by the Host Emulator. The 'display' is a python application which communicates
with the Sming :cpp:class:`Graphics::Display::Virtual` display driver using a TCP socket.
Graphics processing is handled using SDL2.

To start the virtual screen server type ``make virtual-screen`` from your project directory.
The default TCP port is 7780. If you need to change this, use::

    make virtual-screen VSPORT=7780

The screen server's IP address is shown in the caption bar.
Build and run your project in host mode as follows::

    make SMING_ARCH=Host
    make run VSADDR=192.1.2.3
  • Loading branch information
mikee47 committed Aug 12, 2021
1 parent e0257cd commit 7872602
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@
path = Sming/Libraries/GoogleCast
url = https://github.com/slaff/Sming-GoogleCast.git
ignore = dirty
[submodule "Libraries.Graphics"]
path = Sming/Libraries/Graphics
url = https://github.com/mikee47/Sming-Graphics
ignore = dirty
[submodule "Libraries.HardwareSPI"]
path = Sming/Libraries/HardwareSPI
url = https://github.com/mikee47/HardwareSPI
Expand Down
2 changes: 1 addition & 1 deletion Sming/Components/FlashString
6 changes: 4 additions & 2 deletions Sming/Components/Storage/Tools/hwconfig/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# Common functions and definitions
#

import sys, json, platform
from rjsmin import jsmin
import os, sys, json, platform
from collections import OrderedDict

sys.path.insert(1, os.path.expandvars('${SMING_HOME}/../Tools/Python'))
from rjsmin import jsmin

quiet = False

def status(msg):
Expand Down
5 changes: 5 additions & 0 deletions Sming/Core/Data/Range.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ template <typename T> struct TRange {
return s;
}
};

template <typename T> inline String toString(TRange<T> range)
{
return range.toString();
}
1 change: 1 addition & 0 deletions Sming/Libraries/Graphics
Submodule Graphics added at 2375f5
7 changes: 7 additions & 0 deletions Tools/Python/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This directory is for commonly-used python modules. Example usage:

import os, sys

sys.path.insert(1, os.path.expandvars('${SMING_HOME}/../Tools/Python'))

from rjsmin import jsmin
File renamed without changes.
7 changes: 6 additions & 1 deletion Tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ if [ -n "$APPVEYOR" ] || [ -n "$GITHUB_ACTION" ]; then
$PKG_INSTALL \
clang-format-8 \
g++-9-multilib \
python3-setuptools
python3-setuptools \
fonts-ubuntu \
fonts-noto-mono \
xfonts-base \
fonts-urw-base35 \
fonts-droid-fallback

sudo update-alternatives --set gcc /usr/bin/gcc-9

Expand Down
2 changes: 1 addition & 1 deletion Tools/vscode/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def main():
sys.exit(1)

# So we can find rjsmin.py
sys.path.append(os.path.join(env['SMING_HOME'], 'Components/Storage/Tools/hwconfig'))
sys.path.append(os.path.join(env['SMING_HOME'], '../Tools/Python'))

update_intellisense()
update_tasks()
Expand Down

0 comments on commit 7872602

Please sign in to comment.