bootloader_config.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef __BOOT_CONFIG_H__
  14. #define __BOOT_CONFIG_H__
  15. #include <stdint.h>
  16. #ifdef __cplusplus
  17. extern "C"
  18. {
  19. #endif
  20. #include "esp_flash_partitions.h"
  21. #include "soc/soc.h"
  22. #define SPI_SEC_SIZE 0x1000
  23. #define SPI_ERROR_LOG "spi flash error"
  24. #define MAX_OTA_SLOTS 16
  25. typedef struct {
  26. esp_partition_pos_t ota_info;
  27. esp_partition_pos_t factory;
  28. esp_partition_pos_t test;
  29. esp_partition_pos_t ota[MAX_OTA_SLOTS];
  30. uint32_t app_count;
  31. uint32_t selected_subtype;
  32. } bootloader_state_t;
  33. bool flash_encrypt(bootloader_state_t *bs);
  34. /* Indices used by index_to_partition are the OTA index
  35. number, or these special constants */
  36. #define FACTORY_INDEX (-1)
  37. #define TEST_APP_INDEX (-2)
  38. #define INVALID_INDEX (-99)
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif /* __BOOT_CONFIG_H__ */