diff packages/io/flash/current/include/flash.h @ 2816:422d0a343b4d

* include/flash.h: Modest API change: cyg_flash_init() no longer takes a printf function argument. Instead two new API functions are available: cyg_flash_set_printf() and cyg_flash_set_global_printf(). * src/flash.c (CHATTER): Don't attempt output if printf function is NULL. (cyg_flash_init): No longer takes printf arg. (cyg_flash_set_printf): New. Set per-device printf function, locking if needed. (cyg_flash_set_global_printf): New. Set printf function for all devices, locking if needed. * src/flashiodev.c (flashiodev_init): cyg_flash_init no longer takes printf arg, and we can leave global printf at default. * src/flashiodevlegacy.c (flashiodev_init): Ditto. * src/legacy_api.c (flash_init): cyg_flash_init no longer takes printf arg. So call cyg_flash_set_global_printf as well. * src/legacy_dev.c (legacy_flash_init): legacy drivers can't handle NULL printf function, so provide a dummy. * doc/flash.sgml: Document removal of printf functionality of cyg_flash_init() and document cyg_flash_set_printf() and cyg_flash_set_global_printf().
author jlarmour
date Thu, 19 Feb 2009 00:14:26 +0000
parents 74dbf4c3f2e1
children ccce4b32433a
line wrap: on
line diff
--- a/packages/io/flash/current/include/flash.h
+++ b/packages/io/flash/current/include/flash.h
@@ -8,7 +8,7 @@
 // ####ECOSGPLCOPYRIGHTBEGIN####                                            
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009 Free Software Foundation, Inc.
 //
 // eCos is free software; you can redistribute it and/or modify it under    
 // the terms of the GNU General Public License as published by the Free     
@@ -80,7 +80,10 @@ typedef struct {
 } cyg_flash_info_t;
 
 typedef int cyg_flash_printf(const char *fmt, ...);
-__externC int cyg_flash_init( cyg_flash_printf *pf );
+__externC int cyg_flash_init(void);
+__externC int cyg_flash_set_printf(const cyg_flashaddr_t flash_base,
+                                   cyg_flash_printf *pf);
+__externC void cyg_flash_set_global_printf(cyg_flash_printf *pf);
 __externC int cyg_flash_get_info(cyg_uint32 devno, 
                                  cyg_flash_info_t * info);
 __externC int cyg_flash_get_info_addr(const cyg_flashaddr_t flash_base,