@@ -146,7 +146,7 @@ bool wj200_getStatus(modbus_t* ctx, wj200_status* status)
146146
147147void print_modbus_error(struct __comp_state *__comp_inst, const char* msg)
148148{
149- fprintf(stderr,
149+ fprintf(stderr,
150150 "Error: wj200_vfd slave(%d): %s - Modbus error (%d) - %s\n",
151151 mbslaveaddr,
152152 msg,
@@ -175,7 +175,7 @@ void userinit(int argc, char **argv)
175175 {"stopbits", required_argument, 0, 0 },
176176 {"device", required_argument, 0, 0 },
177177 {0, 0, 0, 0}
178- };
178+ };
179179
180180 while(1) {
181181 c = getopt_long(argc, argv, "", options, &opt_index);
@@ -189,8 +189,8 @@ void userinit(int argc, char **argv)
189189
190190 if(baud == 0)
191191 {
192- fprintf(stderr,
193- "Invalid argument: baud must be a number. Given '%s'\n",
192+ fprintf(stderr,
193+ "Invalid argument: buad must be a number. Given '%s'\n",
194194 optarg);
195195 exit(1);
196196 }
@@ -213,20 +213,20 @@ void userinit(int argc, char **argv)
213213
214214 if(data_bits == 0)
215215 {
216- fprintf(stderr,
217- "Invalid argument: databits must be a number. Given '%s'\n",
216+ fprintf(stderr,
217+ "Invalid argument: databits must be a number. Given '%s'\n",
218218 optarg);
219219 exit(1);
220220 }
221221 break;
222222
223223 case 3:
224224 stop_bits = atoi(optarg);
225-
225+
226226 if(stop_bits == 0)
227227 {
228- fprintf(stderr,
229- "Invalid argument: stopbits must be a number. Given '%s'\n",
228+ fprintf(stderr,
229+ "Invalid argument: stopbits must be a number. Given '%s'\n",
230230 optarg);
231231 exit(1);
232232 }
@@ -253,16 +253,16 @@ void userinit(int argc, char **argv)
253253 ctx = modbus_new_rtu(device, baud, parity, data_bits, stop_bits);
254254
255255 if (ctx == NULL) {
256- fprintf(stderr,
257- "ERROR: wj200_vfd unable to create libmodbus context. - %s\n",
256+ fprintf(stderr,
257+ "ERROR: wj200_vfd unable to create libmodbus context. - %s\n",
258258 modbus_strerror(errno));
259259 fprintf(stderr, "Check your commandline!\n");
260- exit(1);
260+ exit(1);
261261 }
262-
262+
263263 if (modbus_connect(ctx)) {
264- fprintf(stderr,
265- "ERROR: wj200_vfd unable to create libmodbus connection. - %s\n",
264+ fprintf(stderr,
265+ "ERROR: wj200_vfd unable to create libmodbus connection. - %s\n",
266266 modbus_strerror(errno));
267267 exit(1);
268268 }
@@ -283,7 +283,7 @@ void user_mainloop(void) {
283283 */
284284 if(mbslaveaddr == 0) {
285285 sleep(1);
286- continue;
286+ continue;
287287 }
288288
289289 modbus_set_slave(ctx, mbslaveaddr);
@@ -318,7 +318,7 @@ void user_mainloop(void) {
318318 else {
319319 calculated_frequency = (uint16_t)(fabs(commanded_frequency) * 100);
320320
321- if(calculated_frequency != status.frequency
321+ if(calculated_frequency != status.frequency
322322 && !wj200_setFrequency(ctx, calculated_frequency)) {
323323 print_modbus_error(__comp_inst, "failed to set frequency");
324324 continue;
0 commit comments