@@ -10,8 +10,7 @@ use std::path::Path;
10
10
use serde:: { Deserialize , Serialize } ;
11
11
12
12
use syn:: Ident ;
13
- use quote:: { quote, format_ident} ;
14
- use proc_macro2:: TokenStream ;
13
+ use quote:: quote;
15
14
16
15
use crate :: board:: Board ;
17
16
use crate :: board:: pinout:: InterfaceMapping ;
@@ -22,7 +21,6 @@ pub type Result = core::result::Result<(), SystemError>;
22
21
#[ derive( Debug ) ]
23
22
pub enum SystemError {
24
23
BoardNotInSystemError ,
25
- UnknownError ,
26
24
}
27
25
28
26
/// A Connection is a physical bus connecting two Boards (e.g. I2C, GPIO, SPI, etc).
@@ -38,24 +36,6 @@ pub struct Connection {
38
36
pub interface_mapping : InterfaceMapping ,
39
37
}
40
38
41
- impl Connection {
42
-
43
- pub fn new ( start_board : Board , end_board : Board , iface_mapping : InterfaceMapping ) -> Self {
44
- Self {
45
- start_board : start_board,
46
- start_pin : String :: new ( ) ,
47
- end_board : end_board,
48
- end_pin : String :: new ( ) ,
49
- interface_mapping : iface_mapping,
50
- }
51
- }
52
-
53
- pub fn display ( & self , _ctx : & egui:: Context , ui : & mut egui:: Ui ) -> egui:: Response {
54
- let label = egui:: Label :: new ( format ! ( "{:?}" , self ) ) . sense ( egui:: Sense :: click ( ) ) ;
55
- ui. add ( label)
56
- }
57
- }
58
-
59
39
/// A system represents the development boards and their interconnections
60
40
#[ derive( Serialize , Deserialize , Clone , Debug , Default ) ]
61
41
pub struct System {
@@ -74,12 +54,12 @@ pub struct System {
74
54
/// A datastructure that will hold all of the information we need to populate the System module.
75
55
#[ derive( Default ) ]
76
56
struct TokenStreamAccumulator {
77
- /// A set of crate Idents that need to be included in the source module.
57
+ /// A set of crate Idents that need to be included in the system module.
78
58
required_bsp_crates : HashSet < Ident > ,
79
- /// A vector of <field>: <type> to include in the System struct declaration.
80
- struct_field_and_type_list : Vec < TokenStream > ,
81
- /// A vector of <field>: <constructor> to include in the System struct constructor.
82
- struct_field_and_constructor_list : Vec < TokenStream > ,
59
+ // // / A vector of <field>: <type> to include in the System struct declaration.
60
+ // struct_field_and_type_list: Vec<TokenStream>,
61
+ // // / A vector of <field>: <constructor> to include in the System struct constructor.
62
+ // struct_field_and_constructor_list: Vec<TokenStream>,
83
63
}
84
64
85
65
impl System {
@@ -140,19 +120,15 @@ impl System {
140
120
// Fold through the list of connections, and capture the required information
141
121
let TokenStreamAccumulator {
142
122
required_bsp_crates,
143
- struct_field_and_type_list,
144
- struct_field_and_constructor_list,
123
+ ..
145
124
} = self . connections . iter ( ) . fold ( TokenStreamAccumulator :: default ( ) , |mut acc, elem| {
146
125
147
126
let Connection {
148
127
start_board,
149
128
end_board,
150
- interface_mapping,
151
129
..
152
130
} = elem;
153
131
154
- // info!("folding a connection... start_board is \n{}\n end board is\n {}", &start_board.get_name(), &end_board.get_name());
155
-
156
132
// get starting board info
157
133
if let Some ( start_board_bsp_info) = & start_board. bsp_parse_info {
158
134
info ! ( " found some bsp info" ) ;
0 commit comments