File tree Expand file tree Collapse file tree 3 files changed +63
-1
lines changed
Expand file tree Collapse file tree 3 files changed +63
-1
lines changed Original file line number Diff line number Diff line change 1313 "maintainer" : true
1414 }
1515 ],
16- "version" : " 7.0.1 " ,
16+ "version" : " 7.0.2 " ,
1717 "frameworks" : " *" ,
1818 "platforms" : " *" ,
1919 "export" : {
Original file line number Diff line number Diff line change 1+ /* !
2+ * @file
3+ * @brief Digital output test double.
4+ */
5+
6+ #ifndef tiny_digital_output_double_hpp
7+ #define tiny_digital_output_double_hpp
8+
9+ extern " C" {
10+ #include " hal/i_tiny_digital_output.h"
11+ }
12+
13+ typedef struct {
14+ i_tiny_digital_output_t interface;
15+ bool state;
16+ } tiny_digital_output_double_t ;
17+
18+ /* !
19+ * Initializes a digital output group test double.
20+ */
21+ void tiny_digital_output_double_init (
22+ tiny_digital_output_double_t * self,
23+ bool initial_state);
24+
25+ /* !
26+ * The current value of the fake output.
27+ */
28+ bool tiny_digital_output_double_state (
29+ tiny_digital_output_double_t * self);
30+
31+ #endif
Original file line number Diff line number Diff line change 1+ /* !
2+ * @file
3+ * @brief
4+ */
5+
6+ #include " double/tiny_digital_output_double.hpp"
7+
8+ static void write (i_tiny_digital_output_t * _self, bool value)
9+ {
10+ auto self = reinterpret_cast <tiny_digital_output_double_t *>(_self);
11+ self->state = value;
12+ }
13+
14+ static const i_tiny_digital_output_api_t api = { write };
15+
16+ void tiny_digital_output_double_init (
17+ tiny_digital_output_double_t * self,
18+ bool initial_state)
19+ {
20+ self->interface .api = &api;
21+ self->state = initial_state;
22+ }
23+
24+ /* !
25+ * The current value of the fake output.
26+ */
27+ bool tiny_digital_output_double_state (
28+ tiny_digital_output_double_t * self)
29+ {
30+ return self->state ;
31+ }
You can’t perform that action at this time.
0 commit comments