Universalize: w25q80bv.c
Co-authored-by: Antoine van Gelder <antoine@greatscottgadgets.com>
This commit is contained in:
parent
70162eef43
commit
797fdd8153
1 changed files with 11 additions and 10 deletions
|
|
@ -27,10 +27,11 @@
|
|||
* programming the flash.
|
||||
*/
|
||||
|
||||
#include "w25q80bv.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "platform_detect.h"
|
||||
#include "w25q80bv.h"
|
||||
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
|
||||
|
|
@ -59,13 +60,13 @@ void w25q80bv_setup(w25q80bv_driver_t* const drv)
|
|||
uint8_t device_id;
|
||||
|
||||
drv->page_len = 256U;
|
||||
#ifdef PRALINE
|
||||
drv->num_pages = 16384U;
|
||||
drv->num_bytes = 4194304U;
|
||||
#else
|
||||
drv->num_pages = 4096U;
|
||||
drv->num_bytes = 1048576U;
|
||||
#endif
|
||||
if (detected_platform() == BOARD_ID_PRALINE) {
|
||||
drv->num_pages = 16384U;
|
||||
drv->num_bytes = 4194304U;
|
||||
} else {
|
||||
drv->num_pages = 4096U;
|
||||
drv->num_bytes = 1048576U;
|
||||
}
|
||||
|
||||
drv->target_init(drv);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue