Skip to content

Commit c5cd813

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents d7f92af + bdaec19 commit c5cd813

File tree

7 files changed

+22
-7
lines changed

7 files changed

+22
-7
lines changed

cores/arduino/Arduino.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ extern "C"{
4343
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (SYSTEM_CORE_CLOCK / 1000L) )
4444
#define microsecondsToClockCycles(a) ( (a) * (SYSTEM_CORE_CLOCK / 1000000L) )
4545

46+
#define digitalPinToInterrupt(P) ( P )
47+
4648
void yield(void);
4749

4850
/* sketch */

libraries/CurieIMU/src/CurieIMU.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ bool CurieIMUClass::begin()
5757
return (CURIE_IMU_CHIP_ID == getDeviceID());
5858
}
5959

60+
void CurieIMUClass::end()
61+
{
62+
ss_spi_disable();
63+
}
64+
6065
int CurieIMUClass::getGyroRate()
6166
{
6267
int rate;

libraries/CurieIMU/src/CurieIMU.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class CurieIMUClass : public BMI160Class {
9595

9696
public:
9797
bool begin(void);
98+
void end(void);
9899

99100
// supported values: 25, 50, 100, 200, 400, 800, 1600, 3200 (Hz)
100101
int getGyroRate();

libraries/CurieIMU/src/internal/ss_spi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ void ss_spi_init()
7373
SS_SPI_REG_WRITE(INTR_MASK, SPI_DISABLE_INT);
7474
}
7575

76+
void ss_spi_disable()
77+
{
78+
/* gate SPI controller clock */
79+
SS_SPI_REG_WRITE(CTRL, 0);
80+
}
81+
7682
static inline
7783
void spi_transmit(uint8_t *buf, size_t count, boolean_t waitCompletion) {
7884
while (count--)

libraries/CurieIMU/src/internal/ss_spi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern "C" {
2525
#endif
2626

2727
void ss_spi_init();
28+
void ss_spi_disable();
2829
int ss_spi_xfer(uint8_t *buf, unsigned tx_cnt, unsigned rx_cnt);
2930

3031
#ifdef __cplusplus

libraries/Wire/examples/master_reader/master_reader.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
void setup()
1616
{
1717
Wire.begin(); // join i2c bus (address optional for master)
18-
Serial1.begin(9600); // start serial for output
18+
Serial.begin(9600); // start serial for output
1919
}
2020

2121
void loop()
@@ -25,8 +25,8 @@ void loop()
2525
while (Wire.available()) // slave may send less than requested
2626
{
2727
char c = Wire.read(); // receive a byte as character
28-
Serial1.print(c); // print the character
29-
Serial1.println();
28+
Serial.print(c); // print the character
29+
Serial.println();
3030

3131
}
3232

libraries/Wire/examples/master_writer/master_writer.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
void setup()
1616
{
1717
Wire.begin(); // join i2c bus (address optional for master)
18-
Serial1.begin(9600);
18+
Serial.begin(9600);
1919
}
2020

2121
byte x = 1;
@@ -26,9 +26,9 @@ void loop()
2626
//Wire.write("x is "); // sends five bytes
2727
Wire.write(x); // sends one byte
2828
int result = Wire.endTransmission(); // stop transmitting
29-
Serial1.println();
30-
Serial1.print("x = ");
31-
Serial1.print(x);
29+
Serial.println();
30+
Serial.print("x = ");
31+
Serial.print(x);
3232
x++;
3333
delay(500);
3434
}

0 commit comments

Comments
 (0)