Changeset 273

Show
Ignore:
Timestamp:
09/29/11 16:52:43 (8 months ago)
Author:
marek
Message:

ap51-flash: add compile time option to clear the screen after successful flash

Signed-off-by: Marek Lindner <lindner_marek@…>

Location:
ap51-flash/trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • ap51-flash/trunk/Makefile

    r267 r273  
    1919# enable debug output 
    2020# EXTRA_CFLAGS += -DDEBUG 
     21# clear screen after each subsequent flash 
     22# EXTRA_CFLAGS += -DCLEAR_SCREEN 
    2123 
    2224# define $EMBED_IMG=/path/to/image to have your image included 
  • ap51-flash/trunk/flash.c

    r270 r273  
    3434static uint8_t our_mac[] = {0x00, 0xba, 0xbe, 0xca, 0xff, 0x00}; 
    3535 
     36#if defined (CLEAR_SCREEN) 
     37int num_nodes_flashed = 0; 
     38#endif 
     39 
    3640#define PACKET_BUFF_LEN 2000 
    3741#define READ_SLEEP_SEC 0 
     
    136140                                break; 
    137141 
    138                         fprintf(stderr, "[%02x:%02x:%02x:%02x:%02x:%02x]: %s: flash complete. Device ready to unplug.\n\n\n\n", 
     142                        fprintf(stderr, "[%02x:%02x:%02x:%02x:%02x:%02x]: %s: flash complete. Device ready to unplug.\n", 
    139143                                node->his_mac_addr[0], node->his_mac_addr[1], node->his_mac_addr[2], 
    140144                                node->his_mac_addr[3], node->his_mac_addr[4], node->his_mac_addr[5], 
    141145                                node->router_type->desc); 
    142146                        node->status = NODE_STATUS_REBOOTED; 
     147#if defined (CLEAR_SCREEN) 
     148                        num_nodes_flashed++; 
     149#endif 
    143150                        break; 
    144151                case NODE_STATUS_REBOOTED: 
  • ap51-flash/trunk/flash.h

    r266 r273  
    1919#include "compat.h" 
    2020 
     21#if defined (CLEAR_SCREEN) 
     22extern int num_nodes_flashed; 
     23#endif 
     24 
    2125struct node *node_list_get(uint8_t *mac_addr); 
    2226void our_mac_set(struct node *node); 
  • ap51-flash/trunk/proto.c

    r272 r273  
    192192        case NODE_STATUS_RESET_SENT: 
    193193        case NODE_STATUS_FINISHED: 
    194                 fprintf(stderr, "[%02x:%02x:%02x:%02x:%02x:%02x]: %s: flash complete. Device ready to unplug.\n\n\n\n", 
     194                fprintf(stderr, "[%02x:%02x:%02x:%02x:%02x:%02x]: %s: flash complete. Device ready to unplug.\n", 
    195195                        node->his_mac_addr[0], node->his_mac_addr[1], node->his_mac_addr[2], 
    196196                        node->his_mac_addr[3], node->his_mac_addr[4], node->his_mac_addr[5], 
    197197                        node->router_type->desc); 
    198198                node->status = NODE_STATUS_REBOOTED; 
     199#if defined (CLEAR_SCREEN) 
     200                num_nodes_flashed++; 
     201#endif 
    199202                break; 
    200203        case NODE_STATUS_REBOOTED: 
  • ap51-flash/trunk/router_types.c

    r265 r273  
    9999                node->router_priv = priv; 
    100100 
     101#if defined (CLEAR_SCREEN) 
     102                if (num_nodes_flashed > 0) 
     103                        system("clear"); 
     104#endif 
     105 
    101106                fprintf(stderr, "[%02x:%02x:%02x:%02x:%02x:%02x]: type '%s' detected\n", 
    102107                        node->his_mac_addr[0], node->his_mac_addr[1], node->his_mac_addr[2],