Print all available baud rates if selected is not supported
authorPiotr Dymacz <pepe2k@gmail.com>
Tue, 28 Apr 2015 22:08:12 +0000 (00:08 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Tue, 28 Apr 2015 22:08:12 +0000 (00:08 +0200)
u-boot/common/cmd_nvedit.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 74e2caa..7850041
@@ -232,7 +232,12 @@ int _do_setenv(int flag, int argc, char *argv[]){
                        }
 
                        if(i == N_BAUDRATES){
-                               printf("## Error: baudrate %d bps not supported\n", baudrate);
+                               printf("## Error: baudrate %d bps is not supported,\n", baudrate);
+                               printf("          choose one from the list:\n\n");
+                               for(i = 0; i < N_BAUDRATES; ++i){
+                                       printf("- %7d bps%s\n", baudrate_table[i], baudrate_table[i] == gd->baudrate ? " [current]" : "");
+                               }
+                               printf("\n");
                                return(1);
                        }