Latest commits (Ultibo core 2.0.235)

Releases, updates and announcements from the Ultibo team.
User avatar
Ultibo
Site Admin
Posts: 2081
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Latest commits (Ultibo core 2.0.235)

Postby Ultibo » Mon Mar 19, 2018 6:00 am

The latest commits for Ultibo core are now available on GitHub. Changes include partial SenseHAT driver, mouse pointer and text cursor support, console line editing and history plus many bug fixes and other enhancements.

This commit does not include as much new functionality as the last major release (which included the VideoCore IV support) but adds many new features and enhancements as well as a significant number of fixes.

List of changes:

  • New SenseHAT driver for 8x8 LED matrix and joystick
  • Mouse cursor (pointer) support for all framebuffer types
  • Text caret (cursor) support for all console types
  • Line editing and history capability for text console and console shell
  • New graphics window functions for plotting diagonal lines and circles
  • New options for ShellUpdate unit to update firmware files or user defined files
  • New option to allow use of a proxy server by ShellUpdate unit
  • Implementation of many IP Helper API functions
  • Add new WARN level to all logging functions
  • Fix for PL011 UART0 driver not reporting first byte when using PEEK_BUFFER or NON_BLOCK
  • New Serial and UART functions for SetProperties, Get/SetStatus and Wait
  • Fix UDP, RAW, ICMP SendTo functions to bind on first use as per Winsock spec
  • Fix GraphicsWindowDrawChar/DrawCharEx/DrawText/DrawTextEx off by one calculating max width and height
  • Fix FramebufferDeviceWrite adding extra row to dirty region mark when not required
  • Fix UDP/TCPClient.RemoteHost using DNS to resolve a numeric address
  • Fix DNS Client sends request for A record when name is an IP address
  • Implement realpath, fsync, inet_pton, inet_ntop, getaddrinfo, getnameinfo and freeaddrinfo in Syscalls unit
  • Fix incorrect check for COLOR_NONE in FramebufferDeviceFillRect
  • Change TSystemCallRequest parameters to PtrUInt for architecture independence
  • Fix UART0 RTS/CTS when using 4 wire serial port
  • Update PlatformRPi2, PlatformRPi3 to support RPi2B revision 2 (BCM2837)
  • Change STARTUP_ADDRESS to be based on _text_start instead of a fixed value
  • Fix console rows and columns value not updating correctly when changing to a smaller font
  • New console window activate, deactivate, next and previous functions
  • Updates to support detection of new Raspberry Pi 3B+

SenseHAT driver

This commit includes a partial driver for the official Raspberry Pi SenseHAT which provides support for the 8x8 LED matrix and the joystick, to use the new driver simply include the RPiSenseHAT unit in your project.

The LED matrix is represented as a framebuffer device and can be accessed using the standard framebuffer or console API, in particular the graphics console unit can be used to draw individual pixels or even shapes and text.

The joystick appears as a keyboard device so the buttons are presented as the up, down, left, right and enter keys, this means input from the joystick will appear in the standard keyboard functions and also in ConsoleReadKey etc.

It is expected that the remaining functions of the SenseHAT, including the temperature, pressure and humidity sensors as well as the gyroscope and accelerometer will be supported in a future update.


Mouse cursor support

As part of expanding support to include all of the elements needed to create useful graphical interfaces and to allow uniform behavior of APIs across all platforms this update includes mouse cursor (pointer) support for all framebuffer devices. Some devices, such as the Raspberry Pi, provide a hardware mouse cursor while others require the cursor to be implemented in software. This means that mouse cursor support now works on QEMU and on TFT LCD devices as well as on the Raspberry Pi HDMI and touch displays, you can even have cursors on multiple displays and track them independently with different mice or pointing devices.

The framebuffer API now includes the following functions which can be used to display and update the mouse cursor regardless of whether it is implemented in software or hardware:

  • FramebufferDeviceSetCursor - Set the mouse cursor image and properties
  • FramebufferDeviceUpdateCursor - Update the position and state of the mouse cursor

Text caret support

The console device has up to now lacked the ability to display a text caret (cursor) at the current point in the line in order to indicate where text input will occur. This commit provides a complete implementation of text caret support for the console framebuffer device (any console device that is backed by a framebuffer) to allow creating and manipulating multiple carets on the display. Other console devices can provide caret support if required by implementing 3 simple functions in their driver.

In addition the console window API has been extended to support showing, hiding, positioning and changing the shape of the text cursor for any current window, see the ConsoleWindowGetCursor*, ConsoleWindowGetCursor* and ConsoleWindowCursor* functions for more information. The cursor support is also available on graphics console windows.

When using the cursor via the console window API it is not necessary to directly call any of the new console device functions (ConsoleDeviceAddCaret, ConsoleDeviceDeleteCaret, ConsoleDeviceUpdateCaret) as the window functions perform all of the required calls for you.


Console line editing and history

Using the new text caret support the console window API has now been enhanced to include a complete line editing and history capability. When calling ConsoleReadLn the line editing and history is automatically enabled to allow use of the left, right, up, down, home, end, delete and insert keys to perform both insert and overtype actions.

A number of new console window functions have also been added to support targeting a specific console window and customizing the behavior, these include:

  • ConsoleWindowRead - As per ConsoleRead but targeted to a specific console window
  • ConsoleWindowReadLn - As per ConsoleReadLn but targeted to a specific console window
  • ConsoleWindowReadLnEx - Extended version to allow controlling all aspects of the read including history, scrolling, colors and tab completion callbacks.

New ShellUpdate unit options

Based on a number of suggestions the ShellUpdate unit has been expanded to include support for updating the Raspberry Pi firmware files as well as updating any file specified on the command line.

A check or update of the firmware files can be initiated by typing UPDATE CHECK FIRMWARE (or UPDATE GET FIRMWARE) at the shell prompt, this will look in the same location as the standard kernel update so you can copy the required firmware files (bootcode.bin, start.elf and fixup.dat) to the same directory on your webserver where you place your kernel images.

Any file can be checked or updated using the command UPDATE CHECK FILE <FILENAME> (or UPDATE GET FILE <FILENAME>) at the shell prompt, again this looks in the same location on your webserver as for kernel updates. For more information and examples type HELP UPDATE at the shell prompt.

The ShellUpdate unit can also now use a proxy server for performing updates by specifying the server and port in the SHELL_UPDATE_HTTP_PROXY setting in cmdine.txt or using the UPDATE SET PROXY command.


New Serial and UART functions

A number of new functions have been added to expand the capability of the Serial and UART API in order to support different use cases. These include:

  • SerialDeviceSetProperties / UARTDeviceSetProperties - Set the properties for the specified device (eg change the baud rate or other settings)
  • SerialDeviceGetStatus / UARTDeviceGetStatus - Get the line status of the specified device (eg RTS, CTS, DTR etc)
  • SerialDeviceSetStatus / UARTDeviceSetStatus - Set the line status of the specified device (eg RTS, CTS, DTR etc)
  • SerialDeviceWait / UARTDeviceWait - Wait for data to be available in the receive or transmit buffers of the specified device

The Synapse synaser unit has also been updated to use a number of these functions resulting in a more efficient implementation.


New console window functions

This commit adds the concept of an active window to the console window API in addition to the existing default window. The active window is, by default, outlined in a different color to other windows and is the one that displays its text caret (if enabled).

For some cases this may require an additional check in your code if you are calling ConsoleReadLn to input text from the keyboard, normally if only one console window exists it will be both the active window and the default window. However if you create multiple windows then you may need to explicitly activate the correct window before calling ConsoleReadLn or ConsoleWindowReadLn to input text.

The new functions available are:

  • ConsoleWindowActivate - Make an existing console window the active window
  • ConsoleWindowDeactivate - Make an existing console window inactive
  • ConsoleWindowNext - Get the next console window starting with the active window
  • ConsoleWindowPrevious - Get the previous console window starting with the active window

Raspberry Pi 3B+ detection

The platform units have been updated to detect the new board identifier of the Raspberry Pi 3B+ and correctly configure the run time environment for it. The new gigabit ethernet interface is not yet supported as it requires a new driver to be written, all other functionality of the 3B+ appears to be working however extensive testing has not yet been completed.

Using the Raspberry Pi 3B+ requires the latest firmware files which are available from https://github.com/raspberrypi/firmware/


For details of how to apply the latest source to your Ultibo core installation and rebuild your run time library see the wiki page Building from Source or watch the Building the RTL video on YouTube.
Ultibo.org | Make something amazing
https://ultibo.org
Gavinmc42
Posts: 1422
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Latest commits (Ultibo core 2.0.235)

Postby Gavinmc42 » Mon Mar 19, 2018 7:49 am

Garry, you must have been making notes of my wish list.
A whole bunch of stuff that fixes little niggles :D

ConsoleDevicePlotLine is the new diagonal line plotting, which is called by GraphicsWindowDrawLine?
Anyway this new features makes for an easy fix for my current project plotting stuff :D

I was spending some time on the weekend modifying the VGshapes demo to get OpenVG plotting with diagonal lines so you beat me to it.
Had a hard time figuring out how to make the VG window align to the GraphicConsole window.
Basically faking up a canvas area the same size as the graphics console area.
Made mistakes, set width/height as the offsets, but it proved the OpenVG scaling stuff works even for tiny windows anywhere on the screen.

Got me thinking about possibilities of using OpenVG windowing to go past the current 4 window limit.
I don't really need full windowing like pik33's but a range of sizes and fixed arrangements with popup windows would be nice.
Partway towards an accelerated GUI then.

Line editing and history will make remote shell much less painful, remote shell mouse options?
Remote file manager and editing now easier with cursoring?
All the bits now to make a Midnight Commander lookalike?

Extra files in updating, yippee, script files, config files, GUI themes, backgrounds....?

Need to get myself a Sensehat ;)

"New console window activate, deactivate, next and previous functions", whoops nearly missed that one :)
Editing in multiple windows?
No Pi3B+'s here till friday/weekend :(
reyncla
Posts: 26
Joined: Thu Jan 04, 2018 1:42 pm

Re: Latest commits (Ultibo core 2.0.235)

Postby reyncla » Mon Mar 19, 2018 4:16 pm

Congratulations to the Ultibo team.

The changes made are excellent !.

I consider that we are getting close to having a GUI, providing buttons, check boxes, text controls ...

Thanks for your effort and dedication.
develone
Posts: 274
Joined: Wed Dec 28, 2016 7:40 pm
Location: El Paso Tx USA

Re: Latest commits (Ultibo core 2.0.235)

Postby develone » Mon Mar 19, 2018 4:51 pm

When my RPi3B+ arrives some time this week I update the bootable micro sd card zip file.

This is going to require changes to Lazarus to support the RPi3B+ is that correct?

Thanks for your efforts..
User avatar
Ultibo
Site Admin
Posts: 2081
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Latest commits (Ultibo core 2.0.235)

Postby Ultibo » Mon Mar 19, 2018 10:10 pm

Gavinmc42 wrote:Line editing and history will make remote shell much less painful, remote shell mouse options?
Remote file manager and editing now easier with cursoring?
All the bits now to make a Midnight Commander lookalike?

Line editing and history only apply to the console so far, support for remote shell will come in another update. The concepts are the same and the work done already will be directly applicable, we just need to work out all the details with handling the ANSI escape sequences. Good news is that the same work would also apply to creating a serial shell option as well.
Ultibo.org | Make something amazing
https://ultibo.org
User avatar
Ultibo
Site Admin
Posts: 2081
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Latest commits (Ultibo core 2.0.235)

Postby Ultibo » Mon Mar 19, 2018 10:13 pm

develone wrote:This is going to require changes to Lazarus to support the RPi3B+ is that correct?

No, the support for RPi3B+ doesn't require any changes to Lazarus or FPC, only the RTL changes contained in this update (and the missing driver for the gigabit ethernet).

When creating a project in Lazarus you can choose either Raspberry Pi 2B or Raspberry Pi 3B and both will work on the new 3B+
Ultibo.org | Make something amazing
https://ultibo.org
Gavinmc42
Posts: 1422
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Latest commits (Ultibo core 2.0.235)

Postby Gavinmc42 » Tue Mar 20, 2018 1:32 am

Line editing and history only apply to the console so far,

I don't remember but did the TextEditor example have mouse and these features working in the old release because it does now ;)

Very strange using TextEditor to make and edit a config.txt file, it is nearly like having a real OS :lol:
I will now be able to edit my configuration files in the application instead of externally via a SD card reader and Windows.
Perhaps Alt/F1/F2 to swap framebuffer/screens, multiple Desktops?
DOS Shell was 1988, it made DOS a mouse clickable OS. Edlin yuck.

ANSI escape sequences, wow, can vaguely remember them, I can wait for remote shell editing/history;)
Got more features to play with in this release and there is still stuff in 2.0 I have not done yet.
User avatar
Ultibo
Site Admin
Posts: 2081
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Latest commits (Ultibo core 2.0.235)

Postby Ultibo » Tue Mar 20, 2018 1:52 am

Gavinmc42 wrote:I don't remember but did the TextEditor example have mouse and these features working in the old release because it does now ;)

One of many things to benefit from these changes, the same example also now works in QEMU including mouse pointer and text cursor.
Ultibo.org | Make something amazing
https://ultibo.org
mark
Posts: 1282
Joined: Mon Oct 03, 2016 2:12 am
Location: Indianapolis, US

Re: Latest commits (Ultibo core 2.0.235)

Postby mark » Tue May 08, 2018 1:28 am

I might have overlooked the announcement but there is a Sende HAT example:

https://github.com/ultibohub/Examples/t ... 9-SenseHAT

Regards, Mark
Ultibo - The Internet of Things that Just Work
User avatar
Ultibo
Site Admin
Posts: 2081
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Latest commits (Ultibo core 2.0.235)

Postby Ultibo » Tue May 08, 2018 1:43 am

mark wrote:I might have overlooked the announcement but there is a Sende HAT example:

True, we said about the Sense HAT driver but didn't ever mention the new example.

Thanks for pointing it out, it's a good example too ;)
Ultibo.org | Make something amazing
https://ultibo.org

Return to “Ultibo”

Who is online

Users browsing this forum: No registered users and 1 guest