Problem with nmea module
Moderators: David Barker, Jerry Messina
-
- Posts: 3
- Joined: Mon Sep 03, 2007 6:52 pm
- Location: Patagual,Chile
Problem with nmea module
in the compile process i have this error into this module:
Cannot promote a register in user source code(try promoting an alias in declaration block instead)
please somebody can explain more detail about this?
Cannot promote a register in user source code(try promoting an alias in declaration block instead)
please somebody can explain more detail about this?
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
-
- Posts: 3
- Joined: Mon Sep 03, 2007 6:52 pm
- Location: Patagual,Chile
I think the SE edition will never compile the NMEA module because the buffer is already 200 bytes
if you used the examples in the same wiki page, you can see
and the TNMEA structure already has a field with a string of 80 bytes ... so this is beyond 256 chars ... far beyond the SE Edition limits. I do not know why the SE edition accept to compile it (I did not tried instead)... but it will never work I think.
Regards
Octal
Code: Select all
#option NMEA_BUFFER_SIZE = 200
...
// These local constants and variables are used by the NMEA interrupt handler
Const NMEABufferSize = NMEA_BUFFER_SIZE // Size of the buffer
Dim FBuffer(NMEABufferSize) As Byte // Array for holding received characters
Code: Select all
// local variables
Dim NMEAItem As TNMEA
Dim NMEAField As String
// this program with display the sentence identifier and the number
// of data fields the sentence has...
USART.SetBaudrate(br4800)
While True
...
Regards
Octal
-
- Posts: 3
- Joined: Mon Sep 03, 2007 6:52 pm
- Location: Patagual,Chile
Tested it. Under SE Edition (last version downloaded today). It does not compile. It does not seem to be a problem with memory size. The exact error is
"Cannot promote a register in user source code(try promoting an alias in declaration block instead)"
at the line with the modifier INDF1.AsChar = "*" in code
Any Idea ?
"Cannot promote a register in user source code(try promoting an alias in declaration block instead)"
at the line with the modifier INDF1.AsChar = "*" in code
Code: Select all
Repeat
POSTINC0 = GetBufferData
If INDF1.AsChar = "*" Then
ChecksumStart = Index + 1
EndIf
Inc(Index)
Until INDF1 = 0
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
This is my fault. I coded the program using a BETA version of the compiler, which accepts the new construct. I've updated the wiki with a new version which should build OK (SE restrictions aside). If you want to change manually, then occurrences of 'AsChar' should be replaced with something like this...
to
Code: Select all
INDF1.AsChar = "*"
Code: Select all
INDF1 = byte("*")