Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d64d48

Browse files
bors[bot]phil-levishudson-ayers
authored
Merge tock#177
177: Tock 2.0 switchover r=hudson-ayers a=phil-levis This PR 1. removes the Tock 1.0 system calls from tock.c, 2. changes `subscribe_cb` to `subscribe_upcall` 3. updates `driver_exists` to use `command2` It **does not** yet change the names (e.g., `command2` to `command`). This because many userspace libraries have not been ported to the new system calls: - [x] tsl2561 @ppannuto tock#182 - [x] temperature @phil-levis tock#178 - [x] ~aes~ - [x] ~st7735~ tock#185 - [x] pca9544a @alevy - [x] lsm303dlhc tock#191 @alexandruradovici - [x] usb @alistair23 tock#189 - [x] ~console~ (minor, fixed in this PR) @phil-levis tock#177 - [x] proximity @alevy tock#181 - [x] ltc294x @alevy tock#180 - [x] ~tmp006~ tock#184 - [x] l3gd20 tock#192 @alexandruradovici - [x] lps35hb tock#187 - [x] humidity @phil-levis tock#178 - [x] max17205 tock#183 - [x] ipc @alevy tock#176, tock#177 This causes an undefined symbol when compiling, so libtock-c is not usable/linkable. But it does compile. As these are fixed, tested, and pushed to `tock-2.0-dev`, I will keep this branch up to date and unblock it when it is ready. Co-authored-by: Philip Levis <[email protected]> Co-authored-by: Hudson Ayers <[email protected]>
2 parents e37a605 + 2e1f1c2 commit 7d64d48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+358
-921
lines changed

examples/rot13_client/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static void rot13_callback(__attribute__ ((unused)) int pid,
1919
struct rot13_buf *rb = (struct rot13_buf*)ud;
2020
printf("%d: %.*s\n", rb->length, rb->length, rb->buf);
2121
delay_ms(500);
22-
ipc_notify_svc(rot13_svc_num);
22+
ipc_notify_service(rot13_svc_num);
2323
}
2424

2525
int main(void) {
@@ -30,12 +30,12 @@ int main(void) {
3030
}
3131

3232
struct rot13_buf *rb = (struct rot13_buf*)buf;
33-
ipc_register_client_cb(rot13_svc_num, rot13_callback, rb);
33+
ipc_register_client_callback(rot13_svc_num, rot13_callback, rb);
3434

3535
rb->length = snprintf(rb->buf, sizeof(rb->buf), "Hello World!");
3636
ipc_share(rot13_svc_num, rb, 64);
3737

38-
ipc_notify_svc(rot13_svc_num);
38+
ipc_notify_service(rot13_svc_num);
3939
return 0;
4040
}
4141

examples/rot13_service/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static void rot13_callback(int pid, int len, int buf, __attribute__ ((unused)) v
2323
}
2424

2525
int main(void) {
26-
ipc_register_svc(rot13_callback, NULL);
26+
ipc_register_service_callback(rot13_callback, NULL);
2727
return 0;
2828
}
2929

examples/sensors/main.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@
99
#include <sound_pressure.h>
1010
#include <temperature.h>
1111
#include <timer.h>
12-
#include <tmp006.h>
1312
#include <tock.h>
1413
#include <tsl2561.h>
1514

16-
static bool isl29035 = false;
17-
// TODO: modify tmp006 to comply with the generic temperature interface
18-
// and then remove tmp006!!!
19-
static bool tmp006 = false;
15+
static bool isl29035 = false;
2016
static bool tsl2561 = false;
2117
static bool lps25hb = false;
2218
static bool temperature = false;
@@ -33,7 +29,6 @@ static void timer_fired(__attribute__ ((unused)) int arg0,
3329
__attribute__ ((unused)) int arg2,
3430
__attribute__ ((unused)) void* ud) {
3531
int light = 0;
36-
int16_t tmp006_temp = 0;
3732
int tsl2561_lux = 0;
3833
int lps25hb_pressure = 0;
3934
int temp = 0;
@@ -46,7 +41,6 @@ static void timer_fired(__attribute__ ((unused)) int arg0,
4641

4742
/* *INDENT-OFF* */
4843
if (isl29035) ambient_light_read_intensity_sync(&light);
49-
if (tmp006) tmp006_read_sync(&tmp006_temp);
5044
if (tsl2561) tsl2561_lux = tsl2561_get_lux_sync();
5145
if (lps25hb) lps25hb_pressure = lps25hb_get_pressure_sync();
5246
if (temperature) temperature_read_sync(&temp);
@@ -58,7 +52,6 @@ static void timer_fired(__attribute__ ((unused)) int arg0,
5852
if (sound_pressure) sound_pressure_read_sync(&sound_pressure_reading);
5953

6054
if (isl29035) printf("ISL29035: Light Intensity: %d\n", light);
61-
if (tmp006) printf("TMP006: Temperature: %d\n", tmp006_temp);
6255
if (tsl2561) printf("TSL2561: Light: %d lux\n", tsl2561_lux);
6356
if (lps25hb) printf("LPS25HB: Pressure: %d\n", lps25hb_pressure);
6457
if (temp) printf("Temperature: %d deg C\n", temp/100);
@@ -79,7 +72,6 @@ int main(void) {
7972
printf("[Sensors] All available sensors on the platform will be sampled.\n");
8073

8174
isl29035 = driver_exists(DRIVER_NUM_AMBIENT_LIGHT);
82-
tmp006 = driver_exists(DRIVER_NUM_TMP006);
8375
tsl2561 = driver_exists(DRIVER_NUM_TSL2561);
8476
lps25hb = driver_exists(DRIVER_NUM_LPS25HB);
8577
temperature = driver_exists(DRIVER_NUM_TEMPERATURE);
@@ -104,4 +96,4 @@ int main(void) {
10496
timer_every(1000, timer_fired, NULL, &timer);
10597

10698
return 0;
107-
}
99+
}

examples/services/ble-env-sense/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ int main (void) {
127127
printf("[BLE] Environmental Sensing IPC Service\n");
128128

129129
// Listen for IPC requests to configure the sensor values.
130-
ipc_register_svc(ipc_callback, NULL);
130+
ipc_register_service_callback(ipc_callback, NULL);
131131

132132
// Setup BLE
133133
conn_handle = simple_ble_init(&ble_config)->conn_handle;

examples/services/ble-env-sense/test-with-sensors/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void do_sensing_cb(__attribute__ ((unused)) int now,
5151

5252
update->type = SENSOR_IRRADIANCE;
5353
update->value = light;
54-
ipc_notify_svc(_svc_num);
54+
ipc_notify_service(_svc_num);
5555
_ipc_done = false;
5656
yield_for(&_ipc_done);
5757
}
@@ -61,7 +61,7 @@ static void do_sensing_cb(__attribute__ ((unused)) int now,
6161

6262
update->type = SENSOR_TEMPERATURE;
6363
update->value = temp;
64-
ipc_notify_svc(_svc_num);
64+
ipc_notify_service(_svc_num);
6565
_ipc_done = false;
6666
yield_for(&_ipc_done);
6767
}
@@ -71,7 +71,7 @@ static void do_sensing_cb(__attribute__ ((unused)) int now,
7171

7272
update->type = SENSOR_HUMIDITY;
7373
update->value = humi;
74-
ipc_notify_svc(_svc_num);
74+
ipc_notify_service(_svc_num);
7575
_ipc_done = false;
7676
yield_for(&_ipc_done);
7777
}
@@ -99,7 +99,7 @@ int main(void) {
9999
delay_ms(1500);
100100

101101
sensor_update_t *update = (sensor_update_t*) buf;
102-
ipc_register_client_cb(_svc_num, ipc_callback, update);
102+
ipc_register_client_callback(_svc_num, ipc_callback, update);
103103
ipc_share(_svc_num, buf, 64);
104104

105105
timer_in(1000, do_sensing_cb, NULL, &_timer);

examples/services/ble-env-sense/test/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ int main(void) {
3838
delay_ms(1500);
3939

4040
sensor_update_t *update = (sensor_update_t*) buf;
41-
ipc_register_client_cb(_svc_num, ipc_callback, update);
41+
ipc_register_client_callback(_svc_num, ipc_callback, update);
4242

4343
update->type = SENSOR_HUMIDITY;
4444
update->value = 185;
4545
ipc_share(_svc_num, buf, 64);
4646

47-
ipc_notify_svc(_svc_num);
47+
ipc_notify_service(_svc_num);
4848
return 0;
4949
}

examples/tests/callback_remove_test01/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int main(void) {
2828
uint32_t frequency = alarm_internal_frequency();
2929
uint32_t interval = (500 / 1000) * frequency + (500 % 1000) * (frequency / 1000);
3030
uint32_t now = alarm_read();
31-
alarm_internal_subscribe((subscribe_cb*) cb, NULL);
31+
alarm_internal_subscribe((subscribe_upcall*) cb, NULL);
3232
alarm_internal_set(now, interval);
3333

3434
// Now block in this app for a while. This should give the timer time to

examples/tests/tmp006/Makefile

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/tests/tmp006/main.c

Lines changed: 0 additions & 90 deletions
This file was deleted.

examples/tutorials/05_ipc/led/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ int main(void) {
5656
// First get the number of LEDs setup on this board.
5757
_number_of_leds = led_count();
5858

59-
ipc_register_svc(ipc_callback, NULL);
59+
ipc_register_service_callback(ipc_callback, NULL);
6060
return 0;
6161
}

0 commit comments

Comments
 (0)