Warnings fixed and remarks from #3666 taken into account

This commit is contained in:
Bertrand Songis
2016-08-01 07:16:33 +02:00
parent f74381bafa
commit 6c34752907
5 changed files with 25 additions and 21 deletions
+4 -4
View File
@@ -96,10 +96,10 @@ void OpenTxSimulator::start(QByteArray & ee, bool tests)
void OpenTxSimulator::start(const char * filename, bool tests)
{
#if defined(PCBSKY9X) && !defined(REVX) && !defined(AR9X)
g_rotenc[0] = 0;
#elif defined(PCBGRUVIN9X)
#if ROTARY_ENCODERS > 0
g_rotenc[0] = 0;
#endif
#if ROTARY_ENCODERS > 1
g_rotenc[1] = 0;
#endif
@@ -165,7 +165,7 @@ void OpenTxSimulator::wheelEvent(int steps)
rotencValue -= 2;
else
rotencValue += 2;
#elif defined(PCBSKY9X) && !defined(REVX) && !defined(AR9X)
#elif defined(PCBSKY9X) && ROTARY_ENCODERS > 0
g_rotenc[0] += steps*4;
#elif defined(PCBGRUVIN9X)
g_rotenc[0] += steps;
+19 -11
View File
@@ -187,18 +187,22 @@ void disable_dsm2(uint32_t port);
// SD driver
#if defined(SIMU)
#define sdInit()
#define sdDone()
#define sdInit()
#define sdDone()
#else
#define sdPoll10ms()
void sdMountPoll();
extern "C" {
void init_SDcard();
void sdInit();
void sdDone();
uint32_t sd_card_ready();
uint32_t sdMounted();
}
#define sdPoll10ms()
void sdMountPoll();
#if defined(__cplusplus)
extern "C" {
#endif
void init_SDcard();
void sdInit();
void sdDone();
uint32_t sd_card_ready();
uint32_t sdMounted();
#if defined(__cplusplus)
}
#endif
#endif
// WDT driver
@@ -251,7 +255,9 @@ void i2cCheck();
// Coproc driver
void coprocInit();
void coprocWriteData(uint8_t *data, uint32_t size);
#if defined(__cplusplus)
void coprocReadData(bool onlytemp=false);
#endif
extern int8_t volumeRequired;
extern uint8_t Coproc_read;
extern int8_t Coproc_valid;
@@ -306,7 +312,9 @@ void rxPdcUsart( void (*pChProcess)(uint8_t x) );
// Second UART driver
void serial2TelemetryInit(unsigned int protocol);
#if defined(__cplusplus)
bool telemetrySecondPortReceive(uint8_t & data);
#endif
extern const uint8_t BootCode[];
-3
View File
@@ -19,10 +19,7 @@
*/
#include "opentx.h"
#include "i2c_driver.h"
#include "twi.h"
#include "board_lowlevel.h"
#include "stdlib.h"
#define I2C_CLK_FAST 400000
@@ -19,7 +19,6 @@
*/
#include "opentx.h"
#include "rtc.h"
#include "i2c_driver.h"
#define DS3231_I2C_ADDR 0x68
+2 -2
View File
@@ -129,7 +129,7 @@ uint32_t twi_master_init(Twi *p_twi, const twi_options_t *p_opt)
uint32_t status = TWI_SUCCESS;
/* Disable TWI interrupts */
p_twi->TWI_IDR = ~0UL;
p_twi->TWI_IDR = ~(uint32_t)0;
/* Dummy read in status register */
p_twi->TWI_SR;
@@ -494,7 +494,7 @@ void twi_disable_slave_mode(Twi *p_twi)
void twi_slave_init(Twi *p_twi, uint32_t ul_device_addr)
{
/* Disable TWI interrupts */
p_twi->TWI_IDR = ~0UL;
p_twi->TWI_IDR = ~(uint32_t)0;
p_twi->TWI_SR;
/* Reset TWI */