Skip to content

Commit e95a33e

Browse files
authored
Merge pull request #23 from Rocketct/master
Modified file system for science kit rev 2
2 parents eb73bcb + 6d277b3 commit e95a33e

File tree

19 files changed

+746
-5
lines changed

19 files changed

+746
-5
lines changed

.github/workflows/compile-examples.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,45 @@ jobs:
4343
- name: Arduino_LSM9DS1
4444
- name: ArduinoBLE
4545
- name: Arduino_CMSIS-DSP
46-
sketch-paths: examples/Nano33BLESenseFirmware
46+
sketch-paths: examples/ScienceKit/Nano33BLESenseFirmware
4747
- fqbn: arduino:mbed_nano:nanorp2040connect
4848
platforms: |
4949
- name: arduino:mbed_nano
5050
libraries: |
5151
- name: Arduino_LSM6DSOX
5252
- name: ArduinoBLE
53-
sketch-paths: examples/RP2040ConnectFirmware
53+
sketch-paths: examples/ScienceKit/RP2040ConnectFirmware
5454
- fqbn: arduino:samd:mkrwifi1010
5555
platforms: |
5656
- name: arduino:samd
5757
libraries: |
5858
- name: ArduinoBLE
5959
- name: Adafruit LSM9DS1 Library
60-
sketch-paths: examples/PhysicsLabFirmware
60+
sketch-paths: examples/ScienceKit/PhysicsLabFirmware
61+
- fqbn: arduino:mbed_nano:nano33ble
62+
platforms: |
63+
- name: arduino:mbed_nano
64+
libraries: |
65+
- name: Arduino_APDS9960
66+
- name: Arduino_HTS221
67+
- name: Arduino_LPS22HB
68+
- name: Arduino_LSM6DSOX
69+
- name: Arduino_BMI270_BMM150
70+
- name: INA2xx
71+
- name: SerialFlash
72+
- name: ArduinoBLE
73+
- name: Arduino_CMSIS-DSP
74+
sketch-paths: examples/ScienceKitR2/Nano33BLESenseFirmware
75+
- fqbn: arduino:samd:mkrwifi1010
76+
platforms: |
77+
- name: arduino:samd
78+
libraries: |
79+
- name: ArduinoBLE
80+
- name: Arduino_LSM6DSOX
81+
- name: Arduino_BMI270_BMM150
82+
- name: INA2xx
83+
- name: SerialFlash
84+
sketch-paths: examples/ScienceKitR2/PhysicsLabFirmware
6185

6286
steps:
6387
- name: Checkout repository
File renamed without changes.
File renamed without changes.

examples/Nano33BLESenseFirmware/Nano33BLESenseFirmware.ino renamed to examples/ScienceKit/Nano33BLESenseFirmware/Nano33BLESenseFirmware.ino

File renamed without changes.
File renamed without changes.

src/INA226.cpp renamed to examples/ScienceKit/PhysicsLabFirmware/INA226.cpp

File renamed without changes.

src/INA226.h renamed to examples/ScienceKit/PhysicsLabFirmware/INA226.h

File renamed without changes.

examples/PhysicsLabFirmware/PhysicsLabFirmware.ino renamed to examples/ScienceKit/PhysicsLabFirmware/PhysicsLabFirmware.ino

File renamed without changes.

examples/RP2040ConnectFirmware/RP2040ConnectFirmware.ino renamed to examples/ScienceKit/RP2040ConnectFirmware/RP2040ConnectFirmware.ino

File renamed without changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include "Arduino.h"
2+
#include "mbed.h"
3+
#include "ArduinoBLE.h"
4+
#include "LowPower.h"
5+
6+
#include "nrf_power.h"
7+
#include "nrf_uarte.h"
8+
#include "nrf_uart.h"
9+
10+
void lowPower()
11+
{
12+
// Disable UARTE0 which is initially enabled by the bootloader
13+
nrf_uarte_task_trigger(NRF_UARTE0, NRF_UARTE_TASK_STOPRX);
14+
while (!nrf_uarte_event_check(NRF_UARTE0, NRF_UARTE_EVENT_RXTO)) ;
15+
NRF_UARTE0->ENABLE = 0;
16+
NRF_UART0->ENABLE = 0;
17+
18+
// Enable DCDC
19+
nrf_power_dcdcen_set(true);
20+
21+
// Turn off LED_BUILTIN
22+
digitalWrite(LED_BUILTIN, LOW);
23+
}
24+
25+
void lowPowerWait(unsigned long time)
26+
{
27+
rtos::ThisThread::sleep_for(time);
28+
}
29+
30+
void lowPowerBleWait(unsigned long time)
31+
{
32+
unsigned long timeRef = millis();
33+
while (millis() - timeRef < time) {
34+
BLE.poll(time - (millis() - timeRef));
35+
}
36+
}

0 commit comments

Comments
 (0)