File tree 2 files changed +80
-4
lines changed
2 files changed +80
-4
lines changed Original file line number Diff line number Diff line change 5
5
"C_Cpp.formatting" : " clangFormat" ,
6
6
"C_Cpp.clang_format_style" : " {BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 80}" ,
7
7
"C_Cpp.clang_format_sortIncludes" : true ,
8
- "C_Cpp.intelliSenseCacheSize" : 0
8
+ "C_Cpp.intelliSenseCacheSize" : 0 ,
9
+ "files.associations" : {
10
+ "atomic" : " cpp" ,
11
+ "array" : " cpp" ,
12
+ "*.tcc" : " cpp" ,
13
+ "bitset" : " cpp" ,
14
+ "cctype" : " cpp" ,
15
+ "chrono" : " cpp" ,
16
+ "clocale" : " cpp" ,
17
+ "cmath" : " cpp" ,
18
+ "condition_variable" : " cpp" ,
19
+ "csignal" : " cpp" ,
20
+ "cstdarg" : " cpp" ,
21
+ "cstddef" : " cpp" ,
22
+ "cstdint" : " cpp" ,
23
+ "cstdio" : " cpp" ,
24
+ "cstdlib" : " cpp" ,
25
+ "cstring" : " cpp" ,
26
+ "ctime" : " cpp" ,
27
+ "cwchar" : " cpp" ,
28
+ "cwctype" : " cpp" ,
29
+ "deque" : " cpp" ,
30
+ "forward_list" : " cpp" ,
31
+ "list" : " cpp" ,
32
+ "unordered_map" : " cpp" ,
33
+ "unordered_set" : " cpp" ,
34
+ "vector" : " cpp" ,
35
+ "exception" : " cpp" ,
36
+ "algorithm" : " cpp" ,
37
+ "any" : " cpp" ,
38
+ "functional" : " cpp" ,
39
+ "iterator" : " cpp" ,
40
+ "map" : " cpp" ,
41
+ "memory" : " cpp" ,
42
+ "memory_resource" : " cpp" ,
43
+ "numeric" : " cpp" ,
44
+ "optional" : " cpp" ,
45
+ "random" : " cpp" ,
46
+ "ratio" : " cpp" ,
47
+ "set" : " cpp" ,
48
+ "string" : " cpp" ,
49
+ "string_view" : " cpp" ,
50
+ "system_error" : " cpp" ,
51
+ "tuple" : " cpp" ,
52
+ "type_traits" : " cpp" ,
53
+ "utility" : " cpp" ,
54
+ "fstream" : " cpp" ,
55
+ "initializer_list" : " cpp" ,
56
+ "iomanip" : " cpp" ,
57
+ "iosfwd" : " cpp" ,
58
+ "iostream" : " cpp" ,
59
+ "istream" : " cpp" ,
60
+ "limits" : " cpp" ,
61
+ "mutex" : " cpp" ,
62
+ "new" : " cpp" ,
63
+ "ostream" : " cpp" ,
64
+ "sstream" : " cpp" ,
65
+ "stdexcept" : " cpp" ,
66
+ "streambuf" : " cpp" ,
67
+ "thread" : " cpp" ,
68
+ "cinttypes" : " cpp" ,
69
+ "typeinfo" : " cpp"
70
+ }
9
71
}
Original file line number Diff line number Diff line change 6
6
7
7
#include " ST-LIB.hpp"
8
8
9
+ uint32_t local_serversocket_port = 8202 ;
10
+ std::string localip = " 127.0.0.1" ;
11
+ std::unique_ptr<ServerSocket> serversocket = nullptr ;
12
+ StackPacket* inputpacket = nullptr ;
13
+
9
14
int main (void ) {
10
15
#ifdef SIM_ON
11
16
SharedMemory::start ();
12
17
#endif
13
-
14
- DigitalOutput led_on (PA1);
18
+ DigitalInput input (PA1);
19
+ bool value = false ;
20
+ serversocket = std::make_unique<ServerSocket>(localip,local_serversocket_port);
21
+ StackPacket* mypacket = new StackPacket (15 ,&value);// Random id
15
22
STLIB::start ();
16
23
17
- Time::register_low_precision_alarm (100 , [&]() { led_on.toggle (); });
24
+ Time::register_low_precision_alarm (100 ,[&](){
25
+ if (mysocket->is_connected () == false ){
26
+ mysocket->reconnect ();
27
+ }
28
+ });
18
29
19
30
while (1 ) {
31
+ value = input.read_pin_state ();
32
+ serversocket->send_packet (mypacket);
20
33
STLIB::update ();
34
+ std::this_thread::sleep_for (std::chrono::milliseconds (500 ));
21
35
}
22
36
}
23
37
You can’t perform that action at this time.
0 commit comments