Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed-dev-bin nRF51822-bluetooth-mdw
Fork of microbit-dal by
Revision 6:2e1c2e0d8c7a, committed 2016-04-07
- Comitter:
- LancasterUniversity
- Date:
- Thu Apr 07 23:39:31 2016 +0100
- Parent:
- 5:f0f1cecd65d8
- Child:
- 7:a4042bbb7f8b
- Commit message:
- Synchronized with git rev cdeabd26
Author: James Devine
microbit-dal: patched armcc incompatibilities.
Changed in this revision
--- a/source/drivers/MicroBitAccelerometer.cpp Thu Apr 07 11:59:19 2016 +0100
+++ b/source/drivers/MicroBitAccelerometer.cpp Thu Apr 07 23:39:31 2016 +0100
@@ -641,7 +641,8 @@
float y = (float) getY(NORTH_EAST_DOWN);
float z = (float) getZ(NORTH_EAST_DOWN);
- roll = atan2(getY(NORTH_EAST_DOWN), getZ(NORTH_EAST_DOWN));
+ roll = atan2((double)getY(NORTH_EAST_DOWN), (double)getZ(NORTH_EAST_DOWN));
+
pitch = atan(-x / (y*sin(roll) + z*cos(roll)));
status |= MICROBIT_ACCEL_PITCH_ROLL_VALID;
}
@@ -707,4 +708,4 @@
{80000, 0x28},
{160000, 0x30},
{640000, 0x38}
-};
+};
\ No newline at end of file
--- a/source/drivers/MicroBitSerial.cpp Thu Apr 07 11:59:19 2016 +0100
+++ b/source/drivers/MicroBitSerial.cpp Thu Apr 07 23:39:31 2016 +0100
@@ -148,7 +148,7 @@
if(nextTail == txBuffHead)
{
MicroBitEvent(MICROBIT_ID_NOTIFY, MICROBIT_SERIAL_EVT_TX_EMPTY);
- detach(IrqType::TxIrq);
+ detach(Serial::TxIrq);
}
//update our tail!
@@ -185,7 +185,7 @@
fiber_wake_on_event(MICROBIT_ID_NOTIFY, MICROBIT_SERIAL_EVT_TX_EMPTY);
//set the TX interrupt
- attach(this, &MicroBitSerial::dataWritten, IrqType::TxIrq);
+ attach(this, &MicroBitSerial::dataWritten, Serial::TxIrq);
return copiedBytes;
}
@@ -231,7 +231,7 @@
if((status & MICROBIT_SERIAL_RX_BUFF_INIT))
{
//ensure that we receive no interrupts after freeing our buffer
- detach(IrqType::RxIrq);
+ detach(Serial::RxIrq);
free(this->rxBuff);
}
@@ -245,7 +245,7 @@
//set the receive interrupt
status |= MICROBIT_SERIAL_RX_BUFF_INIT;
- attach(this, &MicroBitSerial::dataReceived, IrqType::RxIrq);
+ attach(this, &MicroBitSerial::dataReceived, Serial::RxIrq);
return MICROBIT_OK;
}
@@ -259,7 +259,7 @@
if((status & MICROBIT_SERIAL_TX_BUFF_INIT))
{
//ensure that we receive no interrupts after freeing our buffer
- detach(IrqType::TxIrq);
+ detach(Serial::TxIrq);
free(this->txBuff);
}
@@ -813,17 +813,17 @@
lockRx();
if(txBufferedSize() > 0)
- detach(IrqType::TxIrq);
+ detach(Serial::TxIrq);
- detach(IrqType::RxIrq);
+ detach(Serial::RxIrq);
serial_free(&_serial);
serial_init(&_serial, tx, rx);
- attach(this, &MicroBitSerial::dataReceived, IrqType::RxIrq);
+ attach(this, &MicroBitSerial::dataReceived, Serial::RxIrq);
if(txBufferedSize() > 0)
- attach(this, &MicroBitSerial::dataWritten, IrqType::TxIrq);
+ attach(this, &MicroBitSerial::dataWritten, Serial::TxIrq);
this->baud(this->baudrate);
