Newcal / opentx

Automatically exported from code.google.com/p/opentx
0 stars 0 forks source link

Compilation failure, and possible simple code fix #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Which board (stock / gruvin9x / sky9x / Taranis) are you using?
Stock Turnigy 9XR with a ATMEGA128

What is your openTx FW version?
trunk rev 2435
and
tags/release-2413
both fail

What is your openTx EEPROM version?
Does not apply

What steps will reproduce the problem?
1. Enable FRSKY support
2. Enable DSM2 = SERIAL
3. make the code

What is the expected output? What do you see instead?
A nice hex file for flashing
But I get a compile error, see below.

Please provide any additional information below.

The compile error:

opentx.cpp: In function ‘void per10ms()’:
opentx.cpp:296:8: error: no match for ‘operator>=’ in ‘s_current_protocol 
>= (Protocols)4u’
opentx.cpp:296:8: error: no match for ‘operator<=’ in ‘s_current_protocol 
<= (Protocols)6u’

The code:
=========

#if defined(FRSKY) || defined(JETI)
  if (!IS_DSM2_SERIAL_PROTOCOL(s_current_protocol))
    telemetryInterrupt10ms();
#endif

The possible fix:
=================

#if defined(FRSKY) || defined(JETI)
  if (!IS_DSM2_SERIAL_PROTOCOL(s_current_protocol[0]))
    telemetryInterrupt10ms();
#endif

Notes:
======
I suppose that s_current_protocol has been made into an array to handle more 
than one TX running for a given model.
In that case shouldn't the code not iterate over all the s_current_protocol 's 
and call  telemetryInterrupt10ms() once if one of them is a FRSKY or JETI 
protocol?

Isn't the detection of FRSKY or JETI protocol broken?
As far as I can tell there might be other protocols apart from DSM2 serial.
(PROTO_PPM, and the IR protocols at least)

I would test using specific macros for detecting FRSKY and JETI.
Maybe even a IS_TELEMETRY_PROTOCOL macro.

Original issue reported on code.google.com by dkta...@gmail.com on 2 Jun 2013 at 2:11

GoogleCodeExporter commented 8 years ago
Enabling FRSKY by EXT = FRSKY

Original comment by dkta...@gmail.com on 2 Jun 2013 at 2:17

GoogleCodeExporter commented 8 years ago
I commited the code you proposed. As said in the commit log, there is only one 
module on stock / gruvin9x boards.

Original comment by bson...@gmail.com on 2 Jun 2013 at 2:47