@@ -62,7 +62,7 @@ int libswd_drv_mosi_8(libswd_ctx_t *libswdctx, libswd_cmd_t *cmd, char *data, in
6262 static char misodata [8 ], mosidata [8 ];
6363
6464 /* Split output data into char array. */
65- for (i = 0 ;i < 8 ;i ++ ) mosidata [(nLSBfirst == LIBSWD_DIR_LSBFIRST )?(i ):(bits - 1 - i )]= ((1 <<i )& (* data ))?1 :0 ;
65+ for (i = 0 ;i < 8 ;i ++ ) mosidata [(nLSBfirst == LIBSWD_DIR_LSBFIRST )?(i ):(bits - 1 - i )]= ((1 <<i )& (* data ))?1 :0 ;
6666 /* Then send that array into interface hardware. */
6767 res = jtag_interface -> transfer (NULL , bits , mosidata , misodata , 0 );
6868 if (res < 0 ) return LIBSWD_ERROR_DRIVER ;
@@ -91,7 +91,7 @@ int libswd_drv_mosi_32(libswd_ctx_t *libswdctx, libswd_cmd_t *cmd, int *data, in
9191 static char misodata [32 ], mosidata [32 ];
9292
9393 //UrJTAG drivers shift data LSB-First.
94- for (i = 0 ;i < 32 ;i ++ ) mosidata [(nLSBfirst == LIBSWD_DIR_LSBFIRST )?(i ):(bits - 1 - i )]= ((1 <<i )& (* data ))?1 :0 ;
94+ for (i = 0 ;i < 32 ;i ++ ) mosidata [(nLSBfirst == LIBSWD_DIR_LSBFIRST )?(i ):(bits - 1 - i )]= ((1 <<i )& (* data ))?1 :0 ;
9595 res = jtag_interface -> transfer (NULL , bits , mosidata , misodata , 0 );
9696 if (res < 0 ) return LIBSWD_ERROR_DRIVER ;
9797 return i ;
@@ -152,7 +152,7 @@ int libswd_drv_miso_32(libswd_ctx_t *libswdctx, libswd_cmd_t *cmd, int *data, in
152152 LOG_DEBUG ("OpenOCD's libswd_drv_miso_32(libswdctx=@%p, cmd=@%p, data=@%p, bits=%d, nLSBfirst=0x%02X) reads: 0x%08X" , (void * )libswdctx , (void * )cmd , (void * )data , bits , nLSBfirst , * data );
153153 LOG_DEBUG ("OpenOCD's libswd_drv_miso_32() reads: 0x%08X\n" , * data );
154154 return i ;
155- }
155+ }
156156
157157/**
158158 * This function sets interface buffers to MOSI direction.
@@ -161,12 +161,12 @@ int libswd_drv_miso_32(libswd_ctx_t *libswdctx, libswd_cmd_t *cmd, int *data, in
161161 * OpenOCD driver must support "RnW" signal to drive output buffers for TRN.
162162 * \param *libswdctx is the swd context to work on.
163163 * \param bits specify how many clock cycles must be used for TRN.
164- * \return number of bits transmitted or negative LIBSWD_ERROR code on failure.
164+ * \return number of bits transmitted or negative LIBSWD_ERROR code on failure.
165165 */
166166int libswd_drv_mosi_trn (libswd_ctx_t * libswdctx , int bits ){
167167 LOG_DEBUG ("OpenOCD's libswd_drv_mosi_trn(libswdctx=@%p, bits=%d)\n" , (void * )libswdctx , bits );
168168 if (bits < LIBSWD_TURNROUND_MIN_VAL && bits > LIBSWD_TURNROUND_MAX_VAL )
169- return LIBSWD_ERROR_TURNAROUND ;
169+ return LIBSWD_ERROR_TURNAROUND ;
170170
171171 int res , val = 0 ;
172172 static char buf [LIBSWD_TURNROUND_MAX_VAL ];
@@ -175,7 +175,7 @@ int libswd_drv_mosi_trn(libswd_ctx_t *libswdctx, int bits){
175175 if (res < 0 ) return LIBSWD_ERROR_DRIVER ;
176176
177177 /* Clock specified number of bits for proper TRN transaction. */
178- res = jtag_interface -> transfer (NULL , bits , buf , buf , 0 );
178+ res = jtag_interface -> transfer (NULL , bits , buf , buf , 0 );
179179 if (res < 0 ) return LIBSWD_ERROR_DRIVER ;
180180
181181 return bits ;
@@ -188,12 +188,12 @@ int libswd_drv_mosi_trn(libswd_ctx_t *libswdctx, int bits){
188188 * OpenOCD driver must support "RnW" signal to drive output buffers for TRN.
189189 * \param *libswdctx is the swd context to work on.
190190 * \param bits specify how many clock cycles must be used for TRN.
191- * \return number of bits transmitted or negative LIBSWD_ERROR code on failure.
191+ * \return number of bits transmitted or negative LIBSWD_ERROR code on failure.
192192 */
193193int libswd_drv_miso_trn (libswd_ctx_t * libswdctx , int bits ){
194194 LOG_DEBUG ("OpenOCD's libswd_drv_miso_trn(libswdctx=@%p, bits=%d)\n" , (void * )libswdctx , bits );
195195 if (bits < LIBSWD_TURNROUND_MIN_VAL && bits > LIBSWD_TURNROUND_MAX_VAL )
196- return LIBSWD_ERROR_TURNAROUND ;
196+ return LIBSWD_ERROR_TURNAROUND ;
197197
198198 static int res , val = 1 ;
199199 static char buf [LIBSWD_TURNROUND_MAX_VAL ];
@@ -203,9 +203,9 @@ int libswd_drv_miso_trn(libswd_ctx_t *libswdctx, int bits){
203203 if (res < 0 ) return LIBSWD_ERROR_DRIVER ;
204204
205205 /* Clock specified number of bits for proper TRN transaction. */
206- res = jtag_interface -> transfer (NULL , bits , buf , buf , 0 );
206+ res = jtag_interface -> transfer (NULL , bits , buf , buf , 0 );
207207 if (res < 0 ) return LIBSWD_ERROR_DRIVER ;
208-
208+
209209 return bits ;
210210}
211211
@@ -215,7 +215,7 @@ int libswd_drv_miso_trn(libswd_ctx_t *libswdctx, int bits){
215215 * \param *libswdctx is the context to work on.
216216 * \param loglevel is the OpenOCD numerical value of actual loglevel to force
217217 * on LibSWD, or -1 to inherit from actual global settings of OpenOCD.
218- * \return LIBSWD_OK on success, negative LIBSWD_ERROR code on failure.
218+ * \return LIBSWD_OK on success, negative LIBSWD_ERROR code on failure.
219219 */
220220int libswd_log_level_inherit (libswd_ctx_t * libswdctx , int loglevel ){
221221 LOG_DEBUG ("OpenOCD's libswd_log_level_inherit(libswdctx=@%p, loglevel=%d)\n" , (void * )libswdctx , loglevel );
@@ -248,7 +248,7 @@ int libswd_log_level_inherit(libswd_ctx_t *libswdctx, int loglevel){
248248 default :
249249 new_swdlevel = LIBSWD_LOGLEVEL_NORMAL ;
250250 }
251-
251+
252252 int res = libswd_log_level_set (libswdctx , new_swdlevel );
253253 if (res < 0 ) {
254254 LOG_ERROR ("libswd_log_level_set() failed (%s)\n" , libswd_error_string (res ));
@@ -263,7 +263,7 @@ int libswd_log_level_inherit(libswd_ctx_t *libswdctx, int loglevel){
263263 */
264264int libswd_log (libswd_ctx_t * libswdctx , libswd_loglevel_t loglevel , char * msg , ...){
265265 if (libswdctx == NULL ) return LIBSWD_ERROR_NULLCONTEXT ;
266- if (loglevel > LIBSWD_LOGLEVEL_MAX ) return LIBSWD_ERROR_PARAM ;
266+ if (loglevel > LIBSWD_LOGLEVEL_MAX ) return LIBSWD_ERROR_PARAM ;
267267
268268 if (loglevel > libswdctx -> config .loglevel ) return LIBSWD_OK ;
269269 va_list ap ;
0 commit comments