6
6
7
7
#include <wctype.h>
8
8
#include <stddef.h>
9
+ #include <stdio.h>
9
10
10
11
#include <zephyr/net_buf.h>
11
12
#include <zephyr/devicetree.h>
@@ -432,7 +433,18 @@ const char *mtp_code_to_string(uint16_t code)
432
433
433
434
return str ;
434
435
}
436
+ #else
437
+ #define RESET
438
+ #define GREEN
439
+ #define BLUE
440
+ #define MAGENTA
441
+ #define CYAN
442
+ const char * mtp_code_to_string (uint16_t code )
443
+ {
444
+ return (char * )NULL ;
445
+ }
435
446
#endif
447
+
436
448
int mtp_get_pending_packet (struct mtp_context * ctx , struct net_buf * buf )
437
449
{
438
450
if (ctx -> pending_fn ) {
@@ -452,7 +464,7 @@ static void net_buf_add_utf16le(struct net_buf *buf, const char *str)
452
464
uint16_t len = strlen (str ) + 1 ; /* we need the null terminator */
453
465
454
466
for (int i = 0 ; i < len ; i ++ ) {
455
- __ASSERT (ascii7_str [i ] > 0x1F && ascii7_str [i ] < 0x7F ,
467
+ __ASSERT (str [i ] > 0x1F && str [i ] < 0x7F ,
456
468
"Only printable ascii-7 characters are allowed in USB "
457
469
"string descriptors" );
458
470
net_buf_add_le16 (buf , str [i ]);
@@ -516,7 +528,7 @@ static int dir_traverse(uint8_t storage_id, const char *root_path, uint32_t pare
516
528
/* If it's a file, store the path in the array */
517
529
if (sstorage -> files_count < MAX_FILES ) {
518
530
strncpy (sstorage -> filelist [sstorage -> files_count ].name , entry .name ,
519
- MAX_PATH_LEN - 1 );
531
+ MAX_FILE_NAME - 1 );
520
532
sstorage -> filelist [sstorage -> files_count ].size = entry .size ;
521
533
sstorage -> filelist [sstorage -> files_count ].type =
522
534
entry .type ; /* FS_DIR_ENTRY_FILE=0 or FS_DIR_ENTRY_DIR=1 */
0 commit comments