diff --git a/src/spiFlash.cpp b/src/spiFlash.cpp index d9e734f..d7c5e1d 100644 --- a/src/spiFlash.cpp +++ b/src/spiFlash.cpp @@ -406,7 +406,7 @@ int SPIFlash::disable_protection() /* convert bp area (status register) to len in byte */ uint32_t SPIFlash::bp_to_len(uint8_t bp) { - /* 0 -> no sectors protected */ + /* 0 -> no block protected */ if (bp == 0) return 0; @@ -415,16 +415,16 @@ uint32_t SPIFlash::bp_to_len(uint8_t bp) for (int i = 0; i < 4; i++) if ((bp & _flash_model->bp_offset[i])) tmp |= (1 << i); - /* bp code is 2^(bp-1) sectors */ + /* bp code is 2^(bp-1) blocks */ uint16_t nr_sectors = (1 << (tmp-1)); return nr_sectors * 0x10000; } -/* convert len (in byte) to bp (sector protection) */ +/* convert len (in byte) to bp (block protection) */ uint8_t SPIFlash::len_to_bp(uint32_t len) { - /* 0 -> no sector to protect */ + /* 0 -> no block to protect */ if (len == 0) return 0; diff --git a/src/spiFlash.hpp b/src/spiFlash.hpp index c059b5a..44b6c43 100644 --- a/src/spiFlash.hpp +++ b/src/spiFlash.hpp @@ -78,15 +78,15 @@ class SPIFlash { protected: /*! - * \brief convert bit protect to len in byte - * \param[in] bp: byte protection + * \brief convert block protect to len in byte + * \param[in] bp: block protection * \return protect area in byte */ uint32_t bp_to_len(uint8_t bp); /*! - * \brief convert len (in byte) to corresponding bit protect + * \brief convert len (in byte) to corresponding block protect * \param[in] len: len in byte - * \return bp code (based on chip bp[x] position + * \return bp code (based on chip bp[x] position) */ uint8_t len_to_bp(uint32_t len);