Changeset 607:601e333511eb

Show
Ignore:
Timestamp:
06/12/08 13:00:59 (7 months ago)
Author:
Maxime Petazzoni <maxime.petazzoni@…>
Branch:
default
Message:

Add a nxefc_erase_page() function to ease page wipping.

Location:
nxos/base/drivers
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • nxos/base/drivers/_efc.c

    r551 r607  
     1/* Copyright (c) 2008 the NxOS developers 
     2 * 
     3 * See AUTHORS for a full list of the developers. 
     4 * 
     5 * Redistribution of this file is permitted under 
     6 * the terms of the GNU Public License (GPL) version 2. 
     7 */ 
     8 
    19/* Driver for the NXT Embedded Flash Controller. 
    210 */ 
     
    6977} 
    7078 
     79bool nx__efc_erase_page(U32 page, U32 value) { 
     80  U32 data[EFC_PAGE_WORDS] = {value}; 
     81  return nx__efc_write_page(data, page); 
     82} 
     83 
    7184/* TODO: implement other flash operations? */ 
    7285 
  • nxos/base/drivers/_efc.h

    r551 r607  
    55 */ 
    66 
    7 /* Copyright (C) 2008 the NxOS developers 
     7/* Copyright (c) 2008 the NxOS developers 
    88 * 
    99 * See AUTHORS for a full list of the developers. 
     
    8080void nx__efc_read_page(U32 page, U32 *data); 
    8181 
     82/** Erase a page to the given value. 
     83 * 
     84 * @param page The page number in tho flash memory. 
     85 * @param value The value to set on the page (repeated EFC_PAGE_WORDS 
     86 * times). 
     87 */ 
     88bool nx__efc_erase_page(U32 page, U32 value); 
     89 
    8290/*@}*/ 
    8391/*@}*/