Search found 1220 matches
- Sat Jul 11, 2020 9:49 am
- Forum: Compiler
- Topic: Is it possible to store Pin ref in a structure field
- Replies: 4
- Views: 557
Re: Is it possible to store Pin ref in a structure field
I couldn't really find a clean way to avoid it to make things hardware independant. You can't really make it truly hardware independent. The problem is that the PORTx, LATx, and TRISx registers change offsets depending on the device, so once you compile it for one device another device won't work. ...
- Fri Jul 10, 2020 11:46 pm
- Forum: Compiler
- Topic: Is it possible to store Pin ref in a structure field
- Replies: 4
- Views: 557
Re: Is it possible to store Pin ref in a structure field
The library module shift.bas shows the definitions and usage of programmable pins... // a pin structure... structure TPin PortAddr as word // PORT addr (input), LAT addr (output) TrisAddr as word // TRIS addr Pin as byte PinMask as byte end structure The SetInput() and SetOutput() routines show how ...
- Fri Jul 03, 2020 3:28 pm
- Forum: Compiler
- Topic: Default Variable Assignment
- Replies: 27
- Views: 1547
Re: Default Variable Assignment
also, you can't use 'bound()'
'sizeof()' works however
EDIT: Thanks to David the fix for bound() and addressof() will be included in the next update (likely 2.2.3.5)
Code: Select all
dim bdata() as byte = (10,20,30)
// 'symbol not expected'
dim bsize as byte = bound(bdata)
EDIT: Thanks to David the fix for bound() and addressof() will be included in the next update (likely 2.2.3.5)
- Fri Jul 03, 2020 2:42 pm
- Forum: Compiler
- Topic: Default Variable Assignment
- Replies: 27
- Views: 1547
Re: Default Variable Assignment
It seems that one thing you can't do in 2.2.3.4 is initialize a variable using '@' or 'addressof()'
Code: Select all
const cdata() as byte = (1,2,3,4,5,6,7,8)
dim bdata() as byte = (10,20,30)
// both of these produce 'symbol not expected'
dim caddr as longword = @cdata
dim baddr as word = addressof(bdata)
- Sun Jun 28, 2020 11:26 am
- Forum: Compiler
- Topic: Default Variable Assignment
- Replies: 27
- Views: 1547
Re: Default Variable Assignment
How about adding static variables?I'm still looking at ways to make Swordfish more Firewing like in this regard
Code: Select all
Sub MySub()
Static index As Byte = 0
index += 1
Console.Write("Index = ", CStr(index),13,10)
End Sub
- Sun Jun 28, 2020 11:11 am
- Forum: Compiler
- Topic: Default Variable Assignment
- Replies: 27
- Views: 1547
Re: Default Variable Assignment
I'm not sure I really see much of an advantage one way or the other, unless you were going to allow forward references.
Couldn't you always just use a template like this?
What does requiring 'main' get you?
Couldn't you always just use a template like this?
Code: Select all
program myprog
inline sub main()
// main program goes here
end sub
main
end program
- Sun Jun 28, 2020 9:39 am
- Forum: General
- Topic: problems with wiki access??
- Replies: 4
- Views: 745
Re: problems with wiki access??
Must have been... it's working fine this morning.
Thanks for taking a look though.
Thanks for taking a look though.
- Sat Jun 27, 2020 4:05 pm
- Forum: General
- Topic: problems with wiki access??
- Replies: 4
- Views: 745
problems with wiki access??
I've already asked David, but Is it just me or is anyone else having problems accessing the wiki pages? If I try to browse anything under https://www.sfcompiler.co.uk/wiki, the pages take forever to load and when they finally do there's no formatting to them. Tried IE11, firefox54, and chrome 75. Th...
- Sat Jun 27, 2020 3:41 pm
- Forum: Compiler
- Topic: Default Variable Assignment
- Replies: 27
- Views: 1547
Re: Default Variable Assignment
... so in your case that would be Dim value As Word = multiply(2,4) USART.SetBaudrate(br19200) Swap(x,i) You can have initializers setup local variables inside sub/functions too: sub mysub() dim x as byte = 1 ... end sub The declarations have to be before any executable code, just as before without ...
- Sat Jun 27, 2020 3:31 pm
- Forum: General
- Topic: 18FxxQ43 SRAM silicon errata B0
- Replies: 6
- Views: 708
Re: 18FxxQ43 SRAM silicon errata B0
I'm hoping that errata reads "we really screwed up on this one and while we fix it we thought you should know..."
Otherwise they can't be serious, can they?
Otherwise they can't be serious, can they?
- Sat Jun 27, 2020 11:06 am
- Forum: General
- Topic: 18FxxQ43 SRAM silicon errata B0
- Replies: 6
- Views: 708
18FxxQ43 SRAM silicon errata B0
Just a heads up to anyone looking at using the Q43... There's a nasty silicon errata just published that basically makes the chips unusable! 18FxxQ43 errata issue 1.4.1 silicon rev B0 SRAM Readback ------------- Following a device power up sequence, there is a possibility that some SRAM locations wi...
- Tue Jun 23, 2020 2:29 pm
- Forum: Compiler
- Topic: SF can't launch plugins in Win 7 professional
- Replies: 8
- Views: 1972
Re: SF can't launch plugins in Win 7 professional
Can't help with the backup plugin (I've never used it), but to delete a plugin that isn't in the plugin "Uninstall" list you can just delete the folder for the plugin you want to get rid of under the "Plugin" folder. Here are some of the places to look at (win7 x64): C:\Users\<user-name>\AppData\Roa...
- Tue Jun 23, 2020 10:23 am
- Forum: Announcements
- Topic: Online update - 22-06-2020
- Replies: 0
- Views: 962
Online update - 22-06-2020
There is a new compiler update (2.2.3.4) available for registered users. Download: http://www.mecanique-web.co.uk/downloads/swordfish-si.exe and enter your activation key to install. You can view a list of changes here: https://www.sfcompiler.co.uk/wiki/pmwiki.php?n=Swordfish.VersionHistory For SE v...
- Sun Jun 21, 2020 3:08 pm
- Forum: General
- Topic: Diagnostics hardware
- Replies: 13
- Views: 1021
Re: Diagnostics hardware
If you setup the TX to be interrupt-driven you'll get an intr when the TXREG is ready to accept a char, so about the only thing you need to check after loading the TXREG is if you're at the end of your transmit message, and if you are then disable the TXIE until you 're ready to send the next messag...
- Fri Jun 19, 2020 10:41 pm
- Forum: General
- Topic: Diagnostics hardware
- Replies: 13
- Views: 1021
Re: Diagnostics hardware
The 47J53 does have PPS for UART2.
You can use the PPS Tool included with recent compiler updates to help set it up. You'll find a copy in the Tools\PPSTool folder
You can use the PPS Tool included with recent compiler updates to help set it up. You'll find a copy in the Tools\PPSTool folder