diff packages/io/flash/current/src/flash.c @ 2826:ccce4b32433a

* include/flash.h: Reinstate printf arg to cyg_flash_init, but it will now be officially required to be set to NULL. * src/flash.c (cyg_flash_init): Act on printf arg again (even though it's not meant to be non-NULL). * src/flashiodev.c (flashiodev_init): Call cyg_flash_init with NULL. * src/flashiodevlegacy.c (flashiodev_init): Ditto. * src/legacy_api.c (flash_init): Ditto. * doc/flash.sgml: Update cyg_flash_init as above, deprecating use of non-NULL parameter.
author jlarmour
date Fri, 20 Feb 2009 22:06:15 +0000
parents 422d0a343b4d
children
line wrap: on
line diff
--- a/packages/io/flash/current/src/flash.c
+++ b/packages/io/flash/current/src/flash.c
@@ -220,13 +220,17 @@ find_dev(cyg_flashaddr_t addr, int* stat
 // ascending order of address and put them into a linked list. Lastly
 // check if we have any overlap of the addresses.
 __externC int 
-cyg_flash_init(void) 
+cyg_flash_init(cyg_flash_printf *pf)
 {
   int err;
   struct cyg_flash_dev * dev;
   
   CYG_ASSERT(&(cyg_flashdevtab[CYGHWR_IO_FLASH_DEVICE]) == &cyg_flashdevtab_end, "incorrect number of flash devices");
   
+  // In case the printf function has changed.
+  if (NULL != pf)
+      cyg_flash_set_global_printf(pf);
+
   if (init) {
       return CYG_FLASH_ERR_OK;
   }