Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Micromite eXtreme Firmware V5.03 Post ReplyPost New Topic
<< Prev Page of 7
Author
Message << Prev Topic | Next Topic >>
retepsnikrep
Regular Member
Regular Member
Avatar

Joined: 31 December 2007
Location: United Kingdom
Online Status: Offline
Posts: 77
Posted: 09 May 2017 at 5:29am | IP Logged Quote retepsnikrep

Thanks very much for that...

__________________
Check my website www.150mpg.co.uk for details of my Li-Ion Gen1 Honda Insights.


Back to Top View retepsnikrep's Profile Search for other posts by retepsnikrep Visit retepsnikrep's Homepage
 
Cherokeecruiser
Newbie
Newbie


Joined: 25 February 2015
Location: Australia
Online Status: Offline
Posts: 21
Posted: 09 May 2017 at 7:56am | IP Logged Quote Cherokeecruiser

Thanks very much for those additions
Back to Top View Cherokeecruiser's Profile Search for other posts by Cherokeecruiser
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 1851
Posted: 12 May 2017 at 4:17pm | IP Logged Quote matherp

Attached is the latest release 5.3.20 for the 100 and 144-pin parts

2017-05-12_160746_MMX5.3.20.zip

And for the 64-pin part

2017-05-12_160859_MMX645.3.20.zip

This now allows xmodem send and receive of files to be called from within a program. Of course normal use of XMODEM to load a program cannot be used in this way

In addition, this version implements a complete set of routines for handling long strings. These are taken from Geoff's long string CFunctions, but because CFunctions are difficult/impossible in the MMX they are included in the firmware.

The syntax is pretty much the same as the CFunctions although the way they are called is somewhat different.

Geoff's document is attached:

2017-05-12_161240_Long_Strings.pdf

and the changes are best understood by my test program. There is one additional routine which allows you to substitute characters into an existing string

LONGSTRING REPLACE array%() , newstring$, start-position


Note that unlike the CFunctions these calls all use integer arrays to hold the long strings. The calls all check for the arrays being big enough and give an error if any call would exceed the array limits.

Dim a%(100) 'enough for 800 character string
Dim b%(10)
LongString load a%(),16,"1234567890abcdef"
Print "chars 4-9 are: ", LGetStr$(a%(),4,6)
s$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
LongString append a%(),s$
Print "stringlength now :", LLen(a%())
If LInStr(a%(),"ghij") Then
   Print "ghij found"
Else
   Print "ghij not found"
EndIf
Print "convert string to lower case"
LongString lcase a%()
If LInStr(a%(),"ghij") Then
   Print "ghij now found"
Else
   Print "ghij now not found"
EndIf
LongString append a%(),s$
LongString append a%(),s$
LongString append a%(),s$
LongString append a%(),s$
LongString append a%(),s$
LongString append a%(),s$
LongString append a%(),s$
LongString append a%(),s$
LongString append a%(),s$
LongString append a%(),s$
Print "stringlength now :", LLen(a%())
start=1
Do
  p=LInStr(a%(),"ABC",start)
  If p Then Print "ABC found at position ",p
  start=p+1
Loop While p>0
Print "Convert to upper case"
LongString ucase a%()
p=LInStr(a%(),"ABC",start)
If p Then Print "ABC now found at position ",p
LongString left b%(),a%(),20
Print "left-most 20 characters of a% are ",LGetStr$(b%(),1,20)
LongString right b%(),a%(),20
Print "right-most 20 characters of a% are ",LGetStr$(b%(),1,20)
LongString mid b%(),a%(),20,20
Print "chars 20-39 characters of a% are ",LGetStr$(b%(),1,20)
Print "Now clear a%"
LongString clear a%()
Print "a% is now ",LLen(a%()), " characters long"
Print "copy b% to a%"
LongString copy a%(),b%()
If LCompare(a%(),b%())=0 Then Print "Compare :the strings are the same"
Print "a% is now ",LLen(a%()), " characters long"
LongString concat a%(),b%()
Print "a% is now ",LLen(a%()), " characters long"
If LCompare(a%(),b%())=1 Then Print "a% now bigger than b%"
If LCompare(b%(),a%())=-1 Then Print "b% now smaller than a%"
Print "b% is currently ",LGetStr$(b%(),1,30)
LongString replace b%(),"hello",5
Print "b% is now ",LGetStr$(b%(),1,30)






Edited by matherp on 12 May 2017 at 4:33pm
Back to Top View matherp's Profile Search for other posts by matherp
 
CircuitGizmos
Guru
Guru
Avatar

Joined: 08 September 2011
Location: United States
Online Status: Offline
Posts: 980
Posted: 12 May 2017 at 6:31pm | IP Logged Quote CircuitGizmos

matherp wrote:
because CFunctions are difficult/impossible in the MMX


Why?


__________________
Micromites and Maximites! - Beginning Maximite
Back to Top View CircuitGizmos's Profile Search for other posts by CircuitGizmos Visit CircuitGizmos's Homepage
 
TassyJim
Guru
Guru


Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2276
Posted: 13 May 2017 at 5:42am | IP Logged Quote TassyJim

After a successful XMODEM SEND file from within a program, control C doesn't work.

If you abort a transfer or let it time out by starting but not responding, ^C works.
To get control back, I started a second transfer and the aborted with three ^X's

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 1851
Posted: 13 May 2017 at 4:10pm | IP Logged Quote matherp

Quote:
After a successful XMODEM SEND file from within a program, control C doesn't work.


Thanks Jim - One line missing to restore break after the transfer. I'll include in the next update.

Best Regards

Peter
Back to Top View matherp's Profile Search for other posts by matherp
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 1851
Posted: 15 May 2017 at 3:55pm | IP Logged Quote matherp

Attached is the latest release 5.3.21 for the 100 and 144-pin parts

2017-05-15_155141_MMX5.3.21.zip

And for the 64-pin part

2017-05-15_155243_MMX645.3.21.zip

Changes are:

BUGFIX:
Restored CTRL-C action after using XMODEM to send or receive a file

ADDED:

LONGSTRING TRIM nnnn


This removes nnnn characters from the left of a long string. This is very useful for processing incoming datastreams such as net traffic or GPS. The attached code snippet is for finding the next HTTP request but the concept can be used for any datastream


Do While Not Eof(2) 'if anything to process append it to the long string
    LongString append a%(), Input$(10,2)
Loop
  p%=LInStr(a%(),"GET",1) 'identify the start of what we are interested in
  t%=LInStr(a%(),"HTTP",1) 'identify the end of what we are interested in
  s$=LGetStr$(a%(),p%,t%-p%+4) 'get the interesting data as a normal string
  LongString trim a%(),t%+4 'strip this from the front of the long string
Back to Top View matherp's Profile Search for other posts by matherp
 


If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Search the forums using Google.
<< Prev Page of 7
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1094 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.11