Skip to content

Commit 46031de

Browse files
committed
i2c fix. RFDLoader 32-bit.
1 parent 77803e7 commit 46031de

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

CHANGELOG

100755100644
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
CHANGELOG
22

3+
v 1.5.1
4+
- Added support for OSX (contributed by nitsky)
5+
- RFDLoader now supports 32-bit and 64-bit osx snow leopard through mavericks
6+
- fix for i2c not working when BLE stack is active
7+
38
v 1.5
49
- Added support for Flash Memory. See the RFduinoNonBLE flash example
510
sketches for use. More documentation is also available in

RFDLoader

-360 Bytes
Binary file not shown.

libraries/Wire/Wire.cpp

100755100644
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ bool TwoWire::twi_master_init(void)
183183
twi->PSELSCL = SCL_pin_number;
184184
twi->PSELSDA = SDA_pin_number;
185185
twi->FREQUENCY = TWI_FREQUENCY_FREQUENCY_K100 << TWI_FREQUENCY_FREQUENCY_Pos;
186-
NRF_PPI->CH[7].EEP = (uint32_t)&twi->EVENTS_BB;
187-
NRF_PPI->CH[7].TEP = (uint32_t)&twi->TASKS_SUSPEND;
188-
NRF_PPI->CHENCLR = PPI_CHENCLR_CH7_Msk;
186+
rfduino_ppi_channel_unassign(7);
189187
twi->ENABLE = TWI_ENABLE_ENABLE_Enabled << TWI_ENABLE_ENABLE_Pos;
190188

191189
return twi_master_clear_bus();
@@ -204,13 +202,12 @@ uint8_t TwoWire::twi_master_read(uint8_t *data, uint8_t data_length, uint8_t iss
204202

205203
if ((data_length == 1) && (issue_stop_condition == 1))
206204
{
207-
NRF_PPI->CH[7].TEP = (uint32_t)&twi->TASKS_STOP;
205+
rfduino_ppi_channel_assign(7, &twi->EVENTS_BB, &twi->TASKS_STOP);
208206
}
209207
else
210208
{
211-
NRF_PPI->CH[7].TEP = (uint32_t)&twi->TASKS_SUSPEND;
209+
rfduino_ppi_channel_assign(7, &twi->EVENTS_BB, &twi->TASKS_SUSPEND);
212210
}
213-
NRF_PPI->CHENSET = PPI_CHENSET_CH7_Msk;
214211
twi->TASKS_STARTRX = 1;
215212
while(true)
216213
{
@@ -233,7 +230,7 @@ uint8_t TwoWire::twi_master_read(uint8_t *data, uint8_t data_length, uint8_t iss
233230
{
234231
if (issue_stop_condition == 1)
235232
{
236-
NRF_PPI->CH[7].TEP = (uint32_t)&twi->TASKS_STOP;
233+
rfduino_ppi_channel_assign(7, &twi->EVENTS_BB, &twi->TASKS_STOP);
237234
}
238235
}
239236

@@ -252,7 +249,7 @@ uint8_t TwoWire::twi_master_read(uint8_t *data, uint8_t data_length, uint8_t iss
252249
twi->EVENTS_STOPPED = 0;
253250
}
254251

255-
NRF_PPI->CHENCLR = PPI_CHENCLR_CH7_Msk;
252+
rfduino_ppi_channel_unassign(7);
256253
return bytes_received;
257254
}
258255

0 commit comments

Comments
 (0)