@@ -87,35 +87,6 @@ BBShiftStringOutput::~BBShiftStringOutput() {
87
87
}
88
88
}
89
89
90
- static void compilePRUCode (const char * program, const std::string& pru, const std::vector<std::string>& sargs, const std::vector<std::string>& args1) {
91
- std::string log;
92
-
93
- char * args[sargs.size () + 4 + args1.size ()];
94
- int idx = 0 ;
95
- args[idx++] = (char *)" /bin/bash" ;
96
- args[idx++] = (char *)program;
97
- args[idx++] = (char *)pru.c_str ();
98
- log = args[1 ];
99
- log += " " + pru;
100
- for (int x = 0 ; x < sargs.size (); x++) {
101
- args[idx++] = (char *)sargs[x].c_str ();
102
- log += " " + sargs[x];
103
- }
104
- for (int x = 0 ; x < args1.size (); x++) {
105
- args[idx++] = (char *)args1[x].c_str ();
106
- log += " " + args1[x];
107
- }
108
- args[idx] = NULL ;
109
- LogDebug (VB_CHANNELOUT, " BBShiftStringOutput::compilePRUCode() args: %s\n " , log.c_str ());
110
-
111
- pid_t compilePid = fork ();
112
- if (compilePid == 0 ) {
113
- execvp (" /bin/bash" , args);
114
- } else {
115
- wait (NULL );
116
- }
117
- }
118
-
119
90
void BBShiftStringOutput::createOutputLengths (FrameData& d, const std::string& pfx) {
120
91
union {
121
92
uint16_t r[2 ];
@@ -252,12 +223,6 @@ int BBShiftStringOutput::Init(Json::Value config) {
252
223
return 1 ;
253
224
}
254
225
255
- std::vector<std::string> args;
256
- std::vector<std::string> split0args;
257
- std::vector<std::string> split1args;
258
- split0args.push_back (" -DRUNNING_ON_PRU0" );
259
- split1args.push_back (" -DRUNNING_ON_PRU1" );
260
-
261
226
m_licensedOutputs = CapeUtils::INSTANCE.getLicensedOutputs ();
262
227
263
228
config[" base" ] = root;
@@ -307,12 +272,7 @@ int BBShiftStringOutput::Init(Json::Value config) {
307
272
// pru1 controls the reading mux pins so it has to output more pixels than pru0 so it knows pru0 is done
308
273
m_pru1.maxStringLen = m_pru0.maxStringLen + 1 ;
309
274
}
310
- if (m_pru0.maxStringLen ) {
311
- compilePRUCode (" /opt/fpp/src/non-gpl/BBShiftString/compileBBShiftString.sh" , " 0" , args, split0args);
312
- }
313
- if (m_pru1.maxStringLen ) {
314
- compilePRUCode (" /opt/fpp/src/non-gpl/BBShiftString/compileBBShiftString.sh" , " 1" , args, split1args);
315
- }
275
+
316
276
if (!StartPRU ()) {
317
277
return 0 ;
318
278
}
@@ -359,7 +319,7 @@ int BBShiftStringOutput::StartPRU() {
359
319
m_pru1.pru = new BBBPru (1 , true , true );
360
320
m_pru1.pruData = (BBShiftStringData*)m_pru1.pru ->data_ram ;
361
321
362
- m_pru1.pru ->run (" /tmp /BBShiftString_pru1.out" );
322
+ m_pru1.pru ->run (" /opt/fpp/src/non-gpl/BBShiftString /BBShiftString_pru1.out" );
363
323
364
324
createOutputLengths (m_pru1, " pru1" );
365
325
std::this_thread::sleep_for (std::chrono::milliseconds (10 ));
@@ -370,7 +330,7 @@ int BBShiftStringOutput::StartPRU() {
370
330
}
371
331
m_pru0.pru = new BBBPru (0 , true , true );
372
332
m_pru0.pruData = (BBShiftStringData*)m_pru0.pru ->data_ram ;
373
- m_pru0 .pru ->run (" /tmp /BBShiftString_pru0.out" );
333
+ m_pru1 .pru ->run (" /opt/fpp/src/non-gpl/BBShiftString /BBShiftString_pru0.out" );
374
334
createOutputLengths (m_pru0, " pru0" );
375
335
}
376
336
return 1 ;
0 commit comments