From 03c85c0b0e2e7757e847e1e4deb2ef2d9127b14f Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Mon, 12 Apr 2021 17:18:09 +0200 Subject: [PATCH] [ion/device/external_flash] Move model specific code As the N0100 does not have an external flash chip, the code to handle the external flash does not need to be compiled on this model. --- ion/src/device/n0100/Makefile | 1 + .../device/n0100/drivers/external_flash.cpp | 18 ++++++++++++++++++ ion/src/device/n0110/Makefile | 1 + .../drivers/external_flash.cpp | 2 +- ion/src/device/shared/drivers/Makefile | 1 - ion/src/device/shared/usb/Makefile | 2 +- 6 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 ion/src/device/n0100/drivers/external_flash.cpp rename ion/src/device/{shared => n0110}/drivers/external_flash.cpp (99%) diff --git a/ion/src/device/n0100/Makefile b/ion/src/device/n0100/Makefile index 23f6aee1c..ccacc84ab 100644 --- a/ion/src/device/n0100/Makefile +++ b/ion/src/device/n0100/Makefile @@ -1,5 +1,6 @@ ion_device_src += $(addprefix ion/src/device/n0100/drivers/, \ board.cpp \ + external_flash.cpp \ led.cpp \ power.cpp \ reset.cpp \ diff --git a/ion/src/device/n0100/drivers/external_flash.cpp b/ion/src/device/n0100/drivers/external_flash.cpp new file mode 100644 index 000000000..3c86f5bdf --- /dev/null +++ b/ion/src/device/n0100/drivers/external_flash.cpp @@ -0,0 +1,18 @@ +#include + +namespace Ion { +namespace Device { +namespace ExternalFlash { + +void init() {} +void shutdown() {} + +void MassErase() {} +int SectorAtAddress(uint32_t) { return 0; } +void EraseSector(int) {} +void WriteMemory(uint8_t *, const uint8_t *, size_t) {} +void JDECid(uint8_t *, uint8_t *, uint8_t *) {} + +} +} +} diff --git a/ion/src/device/n0110/Makefile b/ion/src/device/n0110/Makefile index a45b545d1..3e6297f6a 100644 --- a/ion/src/device/n0110/Makefile +++ b/ion/src/device/n0110/Makefile @@ -1,6 +1,7 @@ ion_device_src += $(addprefix ion/src/device/n0110/drivers/, \ board.cpp \ cache.cpp \ + external_flash.cpp \ led.cpp \ power.cpp \ reset.cpp \ diff --git a/ion/src/device/shared/drivers/external_flash.cpp b/ion/src/device/n0110/drivers/external_flash.cpp similarity index 99% rename from ion/src/device/shared/drivers/external_flash.cpp rename to ion/src/device/n0110/drivers/external_flash.cpp index 8e8886421..d6b835049 100644 --- a/ion/src/device/shared/drivers/external_flash.cpp +++ b/ion/src/device/n0110/drivers/external_flash.cpp @@ -1,4 +1,4 @@ -#include "external_flash.h" +#include #include #include #include diff --git a/ion/src/device/shared/drivers/Makefile b/ion/src/device/shared/drivers/Makefile index d099cca35..09b03ec12 100644 --- a/ion/src/device/shared/drivers/Makefile +++ b/ion/src/device/shared/drivers/Makefile @@ -12,7 +12,6 @@ ion_device_src += $(addprefix ion/src/device/shared/drivers/, \ display.cpp \ events_keyboard_platform.cpp \ exam_mode.cpp \ - external_flash.cpp \ flash.cpp \ internal_flash.cpp \ keyboard.cpp \ diff --git a/ion/src/device/shared/usb/Makefile b/ion/src/device/shared/usb/Makefile index 791592d5c..a79991d74 100644 --- a/ion/src/device/shared/usb/Makefile +++ b/ion/src/device/shared/usb/Makefile @@ -43,6 +43,7 @@ ion_device_dfu_src += libaxx/src/cxxabi/pure_virtual.cpp ion_device_dfu_src += ion/src/device/shared/usb/boot.cpp ion_device_dfu_src += ion/src/device/$(MODEL)/drivers/board.cpp ion_device_dfu_src += ion/src/device/$(MODEL)/drivers/cache.cpp +ion_device_dfu_src += ion/src/device/$(MODEL)/drivers/external_flash.cpp ion_device_dfu_src += ion/src/device/$(MODEL)/drivers/reset.cpp ion_device_dfu_src += ion/src/device/$(MODEL)/drivers/usb.cpp ion_device_dfu_src += $(addprefix ion/src/device/shared/drivers/, \ @@ -54,7 +55,6 @@ ion_device_dfu_src += $(addprefix ion/src/device/shared/drivers/, \ crc32.cpp \ display.cpp \ events_keyboard_platform.cpp \ - external_flash.cpp \ flash.cpp \ internal_flash.cpp \ keyboard.cpp \