@@ -88,7 +88,7 @@ pub struct AdcDedicated<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> {
88
88
89
89
// App state
90
90
apps : Grant < App , UpcallCount < 1 > , AllowRoCount < 0 > , AllowRwCount < 2 > > ,
91
- appid : OptionalCell < ProcessId > ,
91
+ processid : OptionalCell < ProcessId > ,
92
92
channel : Cell < usize > ,
93
93
94
94
// ADC buffers
@@ -179,7 +179,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
179
179
180
180
// App state
181
181
apps : grant,
182
- appid : OptionalCell :: empty ( ) ,
182
+ processid : OptionalCell :: empty ( ) ,
183
183
channel : Cell :: new ( 0 ) ,
184
184
185
185
// ADC buffers
@@ -332,7 +332,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
332
332
333
333
// cannot sample a buffer without a buffer to sample into
334
334
let mut app_buf_length = 0 ;
335
- let exists = self . appid . map_or ( false , |id| {
335
+ let exists = self . processid . map_or ( false , |id| {
336
336
self . apps
337
337
. enter ( * id, |_, kernel_data| {
338
338
app_buf_length = kernel_data
@@ -345,7 +345,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
345
345
if err == kernel:: process:: Error :: NoSuchApp
346
346
|| err == kernel:: process:: Error :: InactiveApp
347
347
{
348
- self . appid . clear ( ) ;
348
+ self . processid . clear ( ) ;
349
349
}
350
350
} )
351
351
. unwrap_or ( false )
@@ -357,7 +357,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
357
357
// save state for callback
358
358
self . active . set ( true ) ;
359
359
self . mode . set ( AdcMode :: SingleBuffer ) ;
360
- let ret = self . appid . map_or ( Err ( ErrorCode :: NOMEM ) , |id| {
360
+ let ret = self . processid . map_or ( Err ( ErrorCode :: NOMEM ) , |id| {
361
361
self . apps
362
362
. enter ( * id, |app, _| {
363
363
app. app_buf_offset . set ( 0 ) ;
@@ -405,7 +405,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
405
405
if err == kernel:: process:: Error :: NoSuchApp
406
406
|| err == kernel:: process:: Error :: InactiveApp
407
407
{
408
- self . appid . clear ( ) ;
408
+ self . processid . clear ( ) ;
409
409
}
410
410
} )
411
411
. unwrap_or ( Err ( ErrorCode :: NOMEM ) )
@@ -414,7 +414,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
414
414
// failure, clear state
415
415
self . active . set ( false ) ;
416
416
self . mode . set ( AdcMode :: NoMode ) ;
417
- self . appid . map ( |id| {
417
+ self . processid . map ( |id| {
418
418
self . apps
419
419
. enter ( * id, |app, _| {
420
420
app. samples_remaining . set ( 0 ) ;
@@ -424,7 +424,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
424
424
if err == kernel:: process:: Error :: NoSuchApp
425
425
|| err == kernel:: process:: Error :: InactiveApp
426
426
{
427
- self . appid . clear ( ) ;
427
+ self . processid . clear ( ) ;
428
428
}
429
429
} )
430
430
} ) ;
@@ -455,7 +455,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
455
455
// cannot continuously sample without two buffers
456
456
let mut app_buf_length = 0 ;
457
457
let mut next_app_buf_length = 0 ;
458
- let exists = self . appid . map_or ( false , |id| {
458
+ let exists = self . processid . map_or ( false , |id| {
459
459
self . apps
460
460
. enter ( * id, |_, kernel_data| {
461
461
app_buf_length = kernel_data
@@ -472,7 +472,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
472
472
if err == kernel:: process:: Error :: NoSuchApp
473
473
|| err == kernel:: process:: Error :: InactiveApp
474
474
{
475
- self . appid . clear ( ) ;
475
+ self . processid . clear ( ) ;
476
476
}
477
477
} )
478
478
. unwrap_or ( false )
@@ -485,7 +485,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
485
485
self . active . set ( true ) ;
486
486
self . mode . set ( AdcMode :: ContinuousBuffer ) ;
487
487
488
- let ret = self . appid . map_or ( Err ( ErrorCode :: NOMEM ) , |id| {
488
+ let ret = self . processid . map_or ( Err ( ErrorCode :: NOMEM ) , |id| {
489
489
self . apps
490
490
. enter ( * id, |app, _| {
491
491
app. app_buf_offset . set ( 0 ) ;
@@ -546,7 +546,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
546
546
if err == kernel:: process:: Error :: NoSuchApp
547
547
|| err == kernel:: process:: Error :: InactiveApp
548
548
{
549
- self . appid . clear ( ) ;
549
+ self . processid . clear ( ) ;
550
550
}
551
551
} )
552
552
. unwrap_or ( Err ( ErrorCode :: NOMEM ) )
@@ -555,7 +555,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
555
555
// failure, clear state
556
556
self . active . set ( false ) ;
557
557
self . mode . set ( AdcMode :: NoMode ) ;
558
- self . appid . map ( |id| {
558
+ self . processid . map ( |id| {
559
559
self . apps
560
560
. enter ( * id, |app, _| {
561
561
app. samples_remaining . set ( 0 ) ;
@@ -565,7 +565,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
565
565
if err == kernel:: process:: Error :: NoSuchApp
566
566
|| err == kernel:: process:: Error :: InactiveApp
567
567
{
568
- self . appid . clear ( ) ;
568
+ self . processid . clear ( ) ;
569
569
}
570
570
} )
571
571
} ) ;
@@ -584,7 +584,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
584
584
}
585
585
586
586
// clean up state
587
- self . appid . map_or ( Err ( ErrorCode :: FAIL ) , |id| {
587
+ self . processid . map_or ( Err ( ErrorCode :: FAIL ) , |id| {
588
588
self . apps
589
589
. enter ( * id, |app, _| {
590
590
self . active . set ( false ) ;
@@ -615,7 +615,7 @@ impl<'a, A: hil::adc::Adc + hil::adc::AdcHighSpeed> AdcDedicated<'a, A> {
615
615
if err == kernel:: process:: Error :: NoSuchApp
616
616
|| err == kernel:: process:: Error :: InactiveApp
617
617
{
618
- self . appid . clear ( ) ;
618
+ self . processid . clear ( ) ;
619
619
}
620
620
} )
621
621
. unwrap_or ( Err ( ErrorCode :: FAIL ) )
@@ -652,13 +652,13 @@ impl<'a> AdcVirtualized<'a> {
652
652
& self ,
653
653
command : Operation ,
654
654
channel : usize ,
655
- appid : ProcessId ,
655
+ processid : ProcessId ,
656
656
) -> Result < ( ) , ErrorCode > {
657
657
if channel < self . drivers . len ( ) {
658
658
self . apps
659
- . enter ( appid , |app, _| {
659
+ . enter ( processid , |app, _| {
660
660
if self . current_app . is_none ( ) {
661
- self . current_app . set ( appid ) ;
661
+ self . current_app . set ( processid ) ;
662
662
let value = self . call_driver ( command, channel) ;
663
663
if value != Ok ( ( ) ) {
664
664
self . current_app . clear ( ) ;
@@ -705,7 +705,7 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::Client for AdcDedicate
705
705
706
706
// perform callback
707
707
708
- self . appid . map ( |id| {
708
+ self . processid . map ( |id| {
709
709
self . apps
710
710
. enter ( * id, |_app, upcalls| {
711
711
calledback = true ;
@@ -724,15 +724,15 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::Client for AdcDedicate
724
724
if err == kernel:: process:: Error :: NoSuchApp
725
725
|| err == kernel:: process:: Error :: InactiveApp
726
726
{
727
- self . appid . clear ( ) ;
727
+ self . processid . clear ( ) ;
728
728
}
729
729
} )
730
730
} ) ;
731
731
} else if self . active . get ( ) && self . mode . get ( ) == AdcMode :: ContinuousSample {
732
732
// sample ready in continuous sampling operation, keep state
733
733
734
734
// perform callback
735
- self . appid . map ( |id| {
735
+ self . processid . map ( |id| {
736
736
self . apps
737
737
. enter ( * id, |_app, upcalls| {
738
738
calledback = true ;
@@ -751,7 +751,7 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::Client for AdcDedicate
751
751
if err == kernel:: process:: Error :: NoSuchApp
752
752
|| err == kernel:: process:: Error :: InactiveApp
753
753
{
754
- self . appid . clear ( ) ;
754
+ self . processid . clear ( ) ;
755
755
}
756
756
} )
757
757
} ) ;
@@ -795,7 +795,7 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::HighSpeedClient for Ad
795
795
|| self . mode . get ( ) == AdcMode :: ContinuousBuffer )
796
796
{
797
797
// we did expect a buffer. Determine the current application state
798
- self . appid . map ( |id| {
798
+ self . processid . map ( |id| {
799
799
self . apps
800
800
. enter ( * id, |app, kernel_data| {
801
801
// Get both buffers, this shouldn't ever fail since the grant was created
@@ -1056,7 +1056,7 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::HighSpeedClient for Ad
1056
1056
if err == kernel:: process:: Error :: NoSuchApp
1057
1057
|| err == kernel:: process:: Error :: InactiveApp
1058
1058
{
1059
- self . appid . clear ( ) ;
1059
+ self . processid . clear ( ) ;
1060
1060
unexpected_state = true ;
1061
1061
}
1062
1062
} )
@@ -1070,7 +1070,7 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::HighSpeedClient for Ad
1070
1070
// state is consistent. No callback.
1071
1071
self . active . set ( false ) ;
1072
1072
self . mode . set ( AdcMode :: NoMode ) ;
1073
- self . appid . map ( |id| {
1073
+ self . processid . map ( |id| {
1074
1074
self . apps
1075
1075
. enter ( * id, |app, _| {
1076
1076
app. app_buf_offset . set ( 0 ) ;
@@ -1079,7 +1079,7 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> hil::adc::HighSpeedClient for Ad
1079
1079
if err == kernel:: process:: Error :: NoSuchApp
1080
1080
|| err == kernel:: process:: Error :: InactiveApp
1081
1081
{
1082
- self . appid . clear ( ) ;
1082
+ self . processid . clear ( ) ;
1083
1083
}
1084
1084
} )
1085
1085
} ) ;
@@ -1107,18 +1107,18 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> SyscallDriver for AdcDedicated<'
1107
1107
///
1108
1108
/// - `command_num` - which command call this is
1109
1109
/// - `data` - value sent by the application, varying uses
1110
- /// - `_appid ` - application identifier, unused
1110
+ /// - `_processid ` - application identifier, unused
1111
1111
fn command (
1112
1112
& self ,
1113
1113
command_num : usize ,
1114
1114
channel : usize ,
1115
1115
frequency : usize ,
1116
- appid : ProcessId ,
1116
+ processid : ProcessId ,
1117
1117
) -> CommandReturn {
1118
1118
// Return true if this app already owns the ADC capsule, if no app owns
1119
1119
// the ADC capsule, or if the app that is marked as owning the ADC
1120
1120
// capsule no longer exists.
1121
- let match_or_empty_or_nonexistant = self . appid . map_or ( true , |owning_app| {
1121
+ let match_or_empty_or_nonexistant = self . processid . map_or ( true , |owning_app| {
1122
1122
// We have recorded that an app has ownership of the ADC.
1123
1123
1124
1124
// If the ADC is still active, then we need to wait for the operation
@@ -1127,7 +1127,7 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> SyscallDriver for AdcDedicated<'
1127
1127
// we need to verify that that application still exists, and remove
1128
1128
// it as owner if not.
1129
1129
if self . active . get ( ) {
1130
- owning_app == & appid
1130
+ owning_app == & processid
1131
1131
} else {
1132
1132
// Check the app still exists.
1133
1133
//
@@ -1137,12 +1137,12 @@ impl<A: hil::adc::Adc + hil::adc::AdcHighSpeed> SyscallDriver for AdcDedicated<'
1137
1137
// longer exists and we return `true` to signify the
1138
1138
// "or_nonexistant" case.
1139
1139
self . apps
1140
- . enter ( * owning_app, |_, _| owning_app == & appid )
1140
+ . enter ( * owning_app, |_, _| owning_app == & processid )
1141
1141
. unwrap_or ( true )
1142
1142
}
1143
1143
} ) ;
1144
1144
if match_or_empty_or_nonexistant {
1145
- self . appid . set ( appid ) ;
1145
+ self . processid . set ( processid ) ;
1146
1146
} else {
1147
1147
return CommandReturn :: failure ( ErrorCode :: NOMEM ) ;
1148
1148
}
@@ -1228,21 +1228,21 @@ impl SyscallDriver for AdcVirtualized<'_> {
1228
1228
/// - `command_num` - which command call this is
1229
1229
/// - `channel` - requested channel value
1230
1230
/// - `_` - value sent by the application, unused
1231
- /// - `appid ` - application identifier
1231
+ /// - `processid ` - application identifier
1232
1232
fn command (
1233
1233
& self ,
1234
1234
command_num : usize ,
1235
1235
channel : usize ,
1236
1236
_: usize ,
1237
- appid : ProcessId ,
1237
+ processid : ProcessId ,
1238
1238
) -> CommandReturn {
1239
1239
match command_num {
1240
1240
// This driver exists and return the number of channels
1241
1241
0 => CommandReturn :: success_u32 ( self . drivers . len ( ) as u32 ) ,
1242
1242
1243
1243
// Single sample.
1244
1244
1 => {
1245
- let res = self . enqueue_command ( Operation :: OneSample , channel, appid ) ;
1245
+ let res = self . enqueue_command ( Operation :: OneSample , channel, processid ) ;
1246
1246
if res == Ok ( ( ) ) {
1247
1247
CommandReturn :: success ( )
1248
1248
} else {
@@ -1286,8 +1286,8 @@ impl SyscallDriver for AdcVirtualized<'_> {
1286
1286
1287
1287
impl < ' a > hil:: adc:: Client for AdcVirtualized < ' a > {
1288
1288
fn sample_ready ( & self , sample : u16 ) {
1289
- self . current_app . take ( ) . map ( |appid | {
1290
- let _ = self . apps . enter ( appid , |app, upcalls| {
1289
+ self . current_app . take ( ) . map ( |processid | {
1290
+ let _ = self . apps . enter ( processid , |app, upcalls| {
1291
1291
app. pending_command = false ;
1292
1292
let channel = app. channel ;
1293
1293
upcalls
0 commit comments