Merge branch 'schwabe/ar9x_test_and_fix' into next

This commit is contained in:
Bertrand Songis
2016-08-01 07:03:43 +02:00
6 changed files with 17 additions and 6 deletions
+1 -1
View File
@@ -341,7 +341,7 @@ void Open9xSim::updateKeysAndSwitches(bool start)
long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
{
if (hasFocus()) {
#if defined(PCBSKY9X) && !defined(REVX)
#if defined(COPROCESSOR)
Coproc_temp = 23;
Coproc_maxtemp = 28;
#endif
+2 -2
View File
@@ -96,7 +96,7 @@ void OpenTxSimulator::start(QByteArray & ee, bool tests)
void OpenTxSimulator::start(const char * filename, bool tests)
{
#if defined(PCBSKY9X) && !defined(REVX)
#if defined(PCBSKY9X) && !defined(REVX) && !defined(AR9X)
g_rotenc[0] = 0;
#elif defined(PCBGRUVIN9X)
g_rotenc[0] = 0;
@@ -165,7 +165,7 @@ void OpenTxSimulator::wheelEvent(int steps)
rotencValue -= 2;
else
rotencValue += 2;
#elif defined(PCBSKY9X) && !defined(REVX)
#elif defined(PCBSKY9X) && !defined(REVX) && !defined(AR9X)
g_rotenc[0] += steps*4;
#elif defined(PCBGRUVIN9X)
g_rotenc[0] += steps;
+1 -1
View File
@@ -194,7 +194,7 @@ void simuSetKey(uint8_t key, bool state)
KEY_CASE(KEY_UP, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP)
KEY_CASE(KEY_DOWN, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN)
#endif
#if defined(PCBSKY9X) && !defined(REVX)
#if defined(PCBSKY9X) && !defined(REVX) && !defined(AR9X)
KEY_CASE(BTN_REa, PIOB->PIO_PDSR, 0x40)
#elif defined(PCBGRUVIN9X) || defined(PCBMEGA2560)
KEY_CASE(BTN_REa, pind, 0x20)
+1
View File
@@ -18,6 +18,7 @@
* GNU General Public License for more details.
*/
#include "opentx.h"
#include "i2c_driver.h"
#include "twi.h"
#include "board_lowlevel.h"
@@ -18,6 +18,7 @@
* GNU General Public License for more details.
*/
#include "opentx.h"
#include "rtc.h"
#include "i2c_driver.h"
@@ -26,8 +27,9 @@
void readRtc()
{
uint8_t buffer[7];
uint8_t readBuffer[7];
gtm utm;
int res = i2cReadBuffer(DS3231_I2C_ADDR, 0, 2, buffer, 7);
int res = i2cReadBuffer(DS3231_I2C_ADDR, readBuffer, 2, buffer, 7);
if (res != 0)
return;
@@ -46,6 +48,7 @@ void writeRtc(gtm* ptr)
g_rtcTime = gmktime(ptr);
g_ms100 = 0; // start of next second begins now
uint8_t buffer[7];
uint8_t read_buffer[7];
buffer[0] = toBCD(ptr->tm_sec);
buffer[1] = toBCD(ptr->tm_min);
@@ -55,7 +58,7 @@ void writeRtc(gtm* ptr)
buffer[5] = toBCD(ptr->tm_mon + 1);
uint8_t offset = ptr->tm_year >= 100 ? 100 : 0;
buffer[6] = toBCD(ptr->tm_year - offset);
i2cWriteBuffer(DS3231_I2C_ADDR, 0, 1, buffer, 7);
i2cWriteBuffer(DS3231_I2C_ADDR, read_buffer, 1, buffer, 7);
}
void rtcSetTime(struct gtm * t)
+7
View File
@@ -51,6 +51,13 @@ make -j2 firmware
make -j2 simu
make -j2 gtests ; ./gtests
# OpenTX on AR9X
rm -rf *
cmake ${COMMON_OPTIONS} -DPCB=AR9X -DHELI=YES ${SRCDIR}
make -j2 firmware
make -j2 simu
make -j2 gtests ; ./gtests
# OpenTX on Taranis
rm -rf *
cmake ${COMMON_OPTIONS} -DPCB=X9D -DHELI=YES -DLUA=YES -DWARNINGS_AS_ERRORS=YES ${SRCDIR}