Skip to content

Commit 038be7c

Browse files
committed
Exchanging prefix 'Arduino_OTA_Portenta' with 'Arduino_Portenta_OTA' to be consistent with library naming.
1 parent 7110ec6 commit 038be7c

15 files changed

+79
-79
lines changed

examples/OTA_Internal_Flash/OTA_Internal_Flash.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Flash OTA_Usage_Portenta.ino.bin through dfu-util at address 0x08080000
99
*/
1010

11-
#include "Arduino_OTA_Portenta.h"
11+
#include "Arduino_Portenta_OTA.h"
1212

1313
void setup()
1414
{
@@ -17,11 +17,11 @@ void setup()
1717

1818
Serial.println("*****OTA from Internal Flash*****");
1919

20-
Arduino_OTA_Portenta_InternalFlash ota(INTERNAL_FLASH_OFFSET, 0x80000);
21-
Arduino_OTA_Portenta::Error ota_err = Arduino_OTA_Portenta::Error::None;
20+
Arduino_Portenta_OTA_InternalFlash ota(INTERNAL_FLASH_OFFSET, 0x80000);
21+
Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None;
2222

2323
Serial.println("Initializing OTA storage");
24-
if ((ota_err = ota.begin()) != Arduino_OTA_Portenta::Error::None)
24+
if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None)
2525
{
2626
Serial.print ("ota.begin() failed with error code ");
2727
Serial.println((int)ota_err);
@@ -32,7 +32,7 @@ void setup()
3232
ota.setUpdateLen(131728);
3333

3434
Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory");
35-
if ((ota_err = ota.update()) != Arduino_OTA_Portenta::Error::None)
35+
if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None)
3636
{
3737
Serial.print ("ota.update() failed with error code ");
3838
Serial.println((int)ota_err);

examples/OTA_Qspi_Flash/OTA_Qspi_Flash.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
the firmware of the Arduino Portenta H7 using
44
a firmware image stored on the QSPI.
55
*/
6-
#include "Arduino_OTA_Portenta.h"
6+
#include "Arduino_Portenta_OTA.h"
77

88
void setup()
99
{
@@ -12,11 +12,11 @@ void setup()
1212

1313
Serial.println("*****OTA from QSPI Flash*****");
1414

15-
Arduino_OTA_Portenta_QSPI ota(QSPI_FLASH_FATFS_MBR, 2);
16-
Arduino_OTA_Portenta::Error ota_err = Arduino_OTA_Portenta::Error::None;
15+
Arduino_Portenta_OTA_QSPI ota(QSPI_FLASH_FATFS_MBR, 2);
16+
Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None;
1717

1818
Serial.println("Initializing OTA storage");
19-
if ((ota_err = ota.begin()) != Arduino_OTA_Portenta::Error::None)
19+
if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None)
2020
{
2121
Serial.print ("ota.begin() failed with error code ");
2222
Serial.println((int)ota_err);
@@ -27,7 +27,7 @@ void setup()
2727
ota.setUpdateLen(131728);
2828

2929
Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory");
30-
if ((ota_err = ota.update()) != Arduino_OTA_Portenta::Error::None)
30+
if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None)
3131
{
3232
Serial.print ("ota.update() failed with error code ");
3333
Serial.println((int)ota_err);

examples/OTA_SD_Portenta/OTA_SD_Portenta.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
a firmware image stored on a SD card.
55
*/
66

7-
#include "Arduino_OTA_Portenta.h"
7+
#include "Arduino_Portenta_OTA.h"
88

99
void setup()
1010
{
1111
Serial.begin(115200);
1212
while (!Serial) {}
1313

1414
Serial.println("*****OTA from SD*****");
15-
Arduino_OTA_Portenta_SD ota(SD_OFFSET, 10240);
16-
Arduino_OTA_Portenta::Error ota_err = Arduino_OTA_Portenta::Error::None;
15+
Arduino_Portenta_OTA_SD ota(SD_OFFSET, 10240);
16+
Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None;
1717

1818
Serial.println("Initializing OTA storage");
19-
if ((ota_err = ota.begin()) != Arduino_OTA_Portenta::Error::None)
19+
if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None)
2020
{
2121
Serial.print ("ota.begin() failed with error code ");
2222
Serial.println((int)ota_err);
@@ -27,7 +27,7 @@ void setup()
2727
ota.setUpdateLen(131728);
2828

2929
Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory");
30-
if ((ota_err = ota.update()) != Arduino_OTA_Portenta::Error::None)
30+
if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None)
3131
{
3232
Serial.print ("ota.update() failed with error code ");
3333
Serial.println((int)ota_err);

examples/OTA_Usage_Portenta/OTA_Usage_Portenta.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Usage
3-
This example demonstrates how to use the Arduino_OTA_Portenta library to update a
3+
This example demonstrates how to use the Arduino_Portenta_OTA library to update a
44
sketch on any Portenta via the storage types allowed by the board.
55
Steps to update sketch:
66
1) Upload this sketch or any other sketch (this one lights the LED up with different colours).

keywords.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# Class (KEYWORD1)
77
#######################################
88

9-
Arduino_OTA_Portenta_SD KEYWORD1
10-
Arduino_OTA_Portenta_QSPI KEYWORD1
11-
Arduino_OTA_Portenta_InternalFlash KEYWORD1
9+
Arduino_Portenta_OTA_SD KEYWORD1
10+
Arduino_Portenta_OTA_QSPI KEYWORD1
11+
Arduino_Portenta_OTA_InternalFlash KEYWORD1
1212

1313
#######################################
1414
# Methods and Functions (KEYWORD2)

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name=Arduino_OTA_Portenta
1+
name=Arduino_Portenta_OTA
22
version=0.1.0
33
author=Arduino
44
maintainer=Arduino <[email protected]>
@@ -7,5 +7,5 @@ paragraph=This library allows to perform a firmware update on the Arduino Porten
77
category=Communication
88
url=https://github.com/arduino-libraries/Arduino_Portenta_OTA
99
architectures=mbed
10-
includes=Arduino_OTA_Portenta.h
10+
includes=Arduino_Portenta_OTA.h
1111
depends=

src/Arduino_OTA_Portenta.cpp renamed to src/Arduino_Portenta_OTA.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919
* INCLUDE
2020
******************************************************************************/
2121

22-
#include "Arduino_OTA_Portenta.h"
22+
#include "Arduino_Portenta_OTA.h"
2323

2424
/******************************************************************************
2525
CTOR/DTOR
2626
******************************************************************************/
2727

28-
Arduino_OTA_Portenta::Arduino_OTA_Portenta(StorageTypePortenta const storage_type, uint32_t const data_offset)
28+
Arduino_Portenta_OTA::Arduino_Portenta_OTA(StorageTypePortenta const storage_type, uint32_t const data_offset)
2929
: _storage_type{storage_type}
3030
, _data_offset{data_offset}
3131
, _program_length{0}
3232
{
3333

3434
}
3535

36-
Arduino_OTA_Portenta::~Arduino_OTA_Portenta()
36+
Arduino_Portenta_OTA::~Arduino_Portenta_OTA()
3737
{
3838

3939
}
@@ -42,18 +42,18 @@ Arduino_OTA_Portenta::~Arduino_OTA_Portenta()
4242
* PUBLIC MEMBER FUNCTIONS
4343
******************************************************************************/
4444

45-
Arduino_OTA_Portenta::Error Arduino_OTA_Portenta::begin()
45+
Arduino_Portenta_OTA::Error Arduino_Portenta_OTA::begin()
4646
{
4747
Serial1.begin(115200);
4848
return (init() == false) ? Error::OtaStorageInit : Error::None;
4949
}
5050

51-
void Arduino_OTA_Portenta::setUpdateLen(uint32_t const program_length)
51+
void Arduino_Portenta_OTA::setUpdateLen(uint32_t const program_length)
5252
{
5353
_program_length = program_length;
5454
}
5555

56-
Arduino_OTA_Portenta::Error Arduino_OTA_Portenta::update()
56+
Arduino_Portenta_OTA::Error Arduino_Portenta_OTA::update()
5757
{
5858
if(!open())
5959
return Error::OtaStorageOpen;
@@ -64,7 +64,7 @@ Arduino_OTA_Portenta::Error Arduino_OTA_Portenta::update()
6464
return Error::None;
6565
}
6666

67-
void Arduino_OTA_Portenta::reset()
67+
void Arduino_Portenta_OTA::reset()
6868
{
6969
NVIC_SystemReset();
7070
}

src/Arduino_OTA_Portenta.h renamed to src/Arduino_Portenta_OTA.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
a commercial license, send an email to [email protected].
1616
*/
1717

18-
#ifndef ARDUINO_OTA_PORTENTA_H
19-
#define ARDUINO_OTA_PORTENTA_H
18+
#ifndef ARDUINO_PORTENTA_OTA_H_
19+
#define ARDUINO_PORTENTA_OTA_H_
2020

2121
/******************************************************************************
2222
* INCLUDE
@@ -67,7 +67,7 @@ enum StorageTypePortenta {
6767
* CLASS DECLARATION
6868
******************************************************************************/
6969

70-
class Arduino_OTA_Portenta
70+
class Arduino_Portenta_OTA
7171
{
7272
public:
7373

@@ -83,8 +83,8 @@ class Arduino_OTA_Portenta
8383
OtaStorageWrite = -7,
8484
};
8585

86-
Arduino_OTA_Portenta(StorageTypePortenta const storage_type, uint32_t const data_offset);
87-
virtual ~Arduino_OTA_Portenta();
86+
Arduino_Portenta_OTA(StorageTypePortenta const storage_type, uint32_t const data_offset);
87+
virtual ~Arduino_Portenta_OTA();
8888

8989

9090
Error begin();
@@ -112,8 +112,8 @@ class Arduino_OTA_Portenta
112112
* INCLUDE
113113
******************************************************************************/
114114

115-
#include "Arduino_OTA_Portenta_SD.h"
116-
#include "Arduino_OTA_Portenta_QSPI.h"
117-
#include "Arduino_OTA_Portenta_InternalFlash.h"
115+
#include "Arduino_Portenta_OTA_SD.h"
116+
#include "Arduino_Portenta_OTA_QSPI.h"
117+
#include "Arduino_Portenta_OTA_InternalFlash.h"
118118

119-
#endif /* ARDUINO_OTA_PORTENTA_H */
119+
#endif /* ARDUINO_PORTENTA_OTA_H_ */

src/Arduino_OTA_Portenta_InternalFlash.cpp renamed to src/Arduino_Portenta_OTA_InternalFlash.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
INCLUDE
2020
******************************************************************************/
2121

22-
#include "Arduino_OTA_Portenta_InternalFlash.h"
22+
#include "Arduino_Portenta_OTA_InternalFlash.h"
2323

2424
#include <stm32h7xx_hal_rtc_ex.h>
2525

@@ -39,8 +39,8 @@ extern RTC_HandleTypeDef RTCHandle;
3939
CTOR/DTOR
4040
******************************************************************************/
4141

42-
Arduino_OTA_Portenta_InternalFlash::Arduino_OTA_Portenta_InternalFlash(StorageTypePortenta const storage_type, uint32_t const _data_offset)
43-
: Arduino_OTA_Portenta(storage_type, _data_offset)
42+
Arduino_Portenta_OTA_InternalFlash::Arduino_Portenta_OTA_InternalFlash(StorageTypePortenta const storage_type, uint32_t const _data_offset)
43+
: Arduino_Portenta_OTA(storage_type, _data_offset)
4444
, _fs_flash("fs")
4545
, _littlefs_fs_flash("little_fs")
4646
, _update_size_internal_flash{0}
@@ -54,7 +54,7 @@ Arduino_OTA_Portenta_InternalFlash::Arduino_OTA_Portenta_InternalFlash(StorageTy
5454
PUBLIC MEMBER FUNCTIONS
5555
******************************************************************************/
5656

57-
bool Arduino_OTA_Portenta_InternalFlash::init()
57+
bool Arduino_Portenta_OTA_InternalFlash::init()
5858
{
5959
FlashIAPBlockDevice bd(0x8000000 + _data_offset, 2 * 1024 * 1024 - _data_offset);
6060

@@ -88,7 +88,7 @@ bool Arduino_OTA_Portenta_InternalFlash::init()
8888
return false;
8989
}
9090

91-
bool Arduino_OTA_Portenta_InternalFlash::open()
91+
bool Arduino_Portenta_OTA_InternalFlash::open()
9292
{
9393
DIR * dir = NULL;
9494
struct dirent *entry = NULL;
@@ -145,7 +145,7 @@ bool Arduino_OTA_Portenta_InternalFlash::open()
145145
return false;
146146
}
147147

148-
bool Arduino_OTA_Portenta_InternalFlash::write()
148+
bool Arduino_Portenta_OTA_InternalFlash::write()
149149
{
150150
HAL_RTCEx_BKUPWrite(&RTCHandle, RTC_BKP_DR0, 0x07AA);
151151
HAL_RTCEx_BKUPWrite(&RTCHandle, RTC_BKP_DR1, _storage_type);

src/Arduino_OTA_Portenta_InternalFlash.h renamed to src/Arduino_Portenta_OTA_InternalFlash.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@
1515
a commercial license, send an email to [email protected].
1616
*/
1717

18-
#ifndef OTA_STORAGE_INTERNAL_FLASH_H_
19-
#define OTA_STORAGE_INTERNAL_FLASH_H_
18+
#ifndef ARDUINO_PORTENTA_OTA_INTERNAL_FLASH_H_
19+
#define ARDUINO_PORTENTA_OTA_INTERNAL_FLASH_H_
2020

2121
/******************************************************************************
2222
* INCLUDE
2323
******************************************************************************/
2424

25-
#include "Arduino_OTA_Portenta.h"
25+
#include "Arduino_Portenta_OTA.h"
2626

2727
/******************************************************************************
2828
* CLASS DECLARATION
2929
******************************************************************************/
3030

31-
class Arduino_OTA_Portenta_InternalFlash : public Arduino_OTA_Portenta
31+
class Arduino_Portenta_OTA_InternalFlash : public Arduino_Portenta_OTA
3232
{
3333
public:
3434

35-
Arduino_OTA_Portenta_InternalFlash(StorageTypePortenta const storage_type, uint32_t const data_offset);
36-
virtual ~Arduino_OTA_Portenta_InternalFlash() { }
35+
Arduino_Portenta_OTA_InternalFlash(StorageTypePortenta const storage_type, uint32_t const data_offset);
36+
virtual ~Arduino_Portenta_OTA_InternalFlash() { }
3737

3838

3939
protected:
@@ -51,4 +51,4 @@ class Arduino_OTA_Portenta_InternalFlash : public Arduino_OTA_Portenta
5151

5252
};
5353

54-
#endif /* OTA_STORAGE_PORTENTA */
54+
#endif /* ARDUINO_PORTENTA_OTA_INTERNAL_FLASH_H_ */

src/Arduino_OTA_Portenta_QSPI.cpp renamed to src/Arduino_Portenta_OTA_QSPI.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
INCLUDE
2020
******************************************************************************/
2121

22-
#include "Arduino_OTA_Portenta_QSPI.h"
22+
#include "Arduino_Portenta_OTA_QSPI.h"
2323

2424
#include <stm32h7xx_hal_rtc_ex.h>
2525

@@ -37,8 +37,8 @@ extern RTC_HandleTypeDef RTCHandle;
3737
CTOR/DTOR
3838
******************************************************************************/
3939

40-
Arduino_OTA_Portenta_QSPI::Arduino_OTA_Portenta_QSPI(StorageTypePortenta const storage_type, uint32_t const data_offset)
41-
: Arduino_OTA_Portenta(storage_type, data_offset)
40+
Arduino_Portenta_OTA_QSPI::Arduino_Portenta_OTA_QSPI(StorageTypePortenta const storage_type, uint32_t const data_offset)
41+
: Arduino_Portenta_OTA(storage_type, data_offset)
4242
, _bd_qspi{NULL}
4343
, _fs_qspi{NULL}
4444
, _block_device_qspi(PD_11, PD_12, PF_7, PD_13, PF_10, PG_6, QSPIF_POLARITY_MODE_1, 40000000)
@@ -55,7 +55,7 @@ Arduino_OTA_Portenta_QSPI::Arduino_OTA_Portenta_QSPI(StorageTypePortenta const s
5555
PUBLIC MEMBER FUNCTIONS
5656
******************************************************************************/
5757

58-
bool Arduino_OTA_Portenta_QSPI::init()
58+
bool Arduino_Portenta_OTA_QSPI::init()
5959
{
6060
if(_storage_type == QSPI_FLASH_OFFSET)
6161
return (_block_device_qspi.init() == QSPIF_BD_ERROR_OK);
@@ -91,7 +91,7 @@ bool Arduino_OTA_Portenta_QSPI::init()
9191
return false;
9292
}
9393

94-
bool Arduino_OTA_Portenta_QSPI::open()
94+
bool Arduino_Portenta_OTA_QSPI::open()
9595
{
9696
if (_storage_type == QSPI_FLASH_OFFSET)
9797
{
@@ -125,7 +125,7 @@ bool Arduino_OTA_Portenta_QSPI::open()
125125
return false;
126126
}
127127

128-
bool Arduino_OTA_Portenta_QSPI::write()
128+
bool Arduino_Portenta_OTA_QSPI::write()
129129
{
130130
if(_storage_type == QSPI_FLASH_OFFSET ||
131131
_storage_type == QSPI_FLASH_FATFS ||

0 commit comments

Comments
 (0)