@@ -29,26 +29,27 @@ mod status_converted {
29
29
30
30
use riot_sys as raw;
31
31
32
- pub const STATUS_NOT_FOUND : i32 = raw:: STATUS_NOT_FOUND as i32 ;
33
- pub const STATUS_STOPPED : i32 = raw:: STATUS_STOPPED as i32 ;
34
- pub const STATUS_SLEEPING : i32 = raw:: STATUS_SLEEPING as i32 ;
35
- pub const STATUS_MUTEX_BLOCKED : i32 = raw:: STATUS_MUTEX_BLOCKED as i32 ;
36
- pub const STATUS_RECEIVE_BLOCKED : i32 = raw:: STATUS_RECEIVE_BLOCKED as i32 ;
37
- pub const STATUS_SEND_BLOCKED : i32 = raw:: STATUS_SEND_BLOCKED as i32 ;
38
- pub const STATUS_REPLY_BLOCKED : i32 = raw:: STATUS_REPLY_BLOCKED as i32 ;
39
- pub const STATUS_FLAG_BLOCKED_ANY : i32 = raw:: STATUS_FLAG_BLOCKED_ANY as i32 ;
40
- pub const STATUS_FLAG_BLOCKED_ALL : i32 = raw:: STATUS_FLAG_BLOCKED_ALL as i32 ;
41
- pub const STATUS_MBOX_BLOCKED : i32 = raw:: STATUS_MBOX_BLOCKED as i32 ;
42
- pub const STATUS_RUNNING : i32 = raw:: STATUS_RUNNING as i32 ;
43
- pub const STATUS_PENDING : i32 = raw:: STATUS_PENDING as i32 ;
32
+ // STATUS_NOT_FOUND is not added here as it's not a proper status but rather a sentinel value,
33
+ // which moreover can't be processed in its current form by bindgen and would need to be copied
34
+ // over in here by manual expansion of the macro definition.
35
+ pub const STATUS_STOPPED : i32 = raw:: thread_state_t_STATUS_STOPPED as i32 ;
36
+ pub const STATUS_SLEEPING : i32 = raw:: thread_state_t_STATUS_SLEEPING as i32 ;
37
+ pub const STATUS_MUTEX_BLOCKED : i32 = raw:: thread_state_t_STATUS_MUTEX_BLOCKED as i32 ;
38
+ pub const STATUS_RECEIVE_BLOCKED : i32 = raw:: thread_state_t_STATUS_RECEIVE_BLOCKED as i32 ;
39
+ pub const STATUS_SEND_BLOCKED : i32 = raw:: thread_state_t_STATUS_SEND_BLOCKED as i32 ;
40
+ pub const STATUS_REPLY_BLOCKED : i32 = raw:: thread_state_t_STATUS_REPLY_BLOCKED as i32 ;
41
+ pub const STATUS_FLAG_BLOCKED_ANY : i32 = raw:: thread_state_t_STATUS_FLAG_BLOCKED_ANY as i32 ;
42
+ pub const STATUS_FLAG_BLOCKED_ALL : i32 = raw:: thread_state_t_STATUS_FLAG_BLOCKED_ALL as i32 ;
43
+ pub const STATUS_MBOX_BLOCKED : i32 = raw:: thread_state_t_STATUS_MBOX_BLOCKED as i32 ;
44
+ pub const STATUS_RUNNING : i32 = raw:: thread_state_t_STATUS_RUNNING as i32 ;
45
+ pub const STATUS_PENDING : i32 = raw:: thread_state_t_STATUS_PENDING as i32 ;
44
46
}
45
47
46
48
#[ derive( Debug ) ]
47
49
pub enum Status {
48
50
// I would not rely on any properties of the assigned values, but it might make the conversion
49
51
// points easier on the generated code if it can be reasoned down to a simple check of whether
50
52
// it's in range.
51
- NotFound = status_converted:: STATUS_NOT_FOUND as isize ,
52
53
Stopped = status_converted:: STATUS_STOPPED as isize ,
53
54
Sleeping = status_converted:: STATUS_SLEEPING as isize ,
54
55
MutexBlocked = status_converted:: STATUS_MUTEX_BLOCKED as isize ,
@@ -79,7 +80,6 @@ impl Status {
79
80
80
81
fn from_int ( status : i32 ) -> Self {
81
82
match status {
82
- status_converted:: STATUS_NOT_FOUND => Status :: NotFound ,
83
83
status_converted:: STATUS_STOPPED => Status :: Stopped ,
84
84
status_converted:: STATUS_SLEEPING => Status :: Sleeping ,
85
85
status_converted:: STATUS_MUTEX_BLOCKED => Status :: MutexBlocked ,
0 commit comments