Skip to content

Commit 0aaadb9

Browse files
committed
qt: renamed chip DB API to use objectMethod format
1 parent 1244f3e commit 0aaadb9

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

qt/chip_db.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ static ChipInfo chipDB[] =
1212
{ CHIP_ID_K9F2G08U0C, "K9F2G08U0C", 0x800, 0x20000, 0x10000000 },
1313
};
1414

15-
uint32_t getChipDB(ChipInfo *&db)
15+
uint32_t chipDbGet(ChipInfo *&db)
1616
{
1717
db = chipDB;
1818

1919
return CHIP_ID_LAST;
2020
}
2121

22-
ChipInfo *getChipInfoByName(char *name)
22+
ChipInfo *chipInfoGetByName(char *name)
2323
{
2424
for (int id = 0; id < CHIP_ID_LAST; id++)
2525
{
@@ -30,17 +30,17 @@ ChipInfo *getChipInfoByName(char *name)
3030
return 0;
3131
}
3232

33-
ChipInfo *getChipInfoById(uint32_t id)
33+
ChipInfo *chipInfoGetById(uint32_t id)
3434
{
3535
if (id == CHIP_ID_NONE || id >= CHIP_ID_LAST)
3636
return NULL;
3737

3838
return &chipDB[id];
3939
}
4040

41-
uint32_t getChipPageSize(uint32_t id)
41+
uint32_t chipPageSizeGet(uint32_t id)
4242
{
43-
ChipInfo *info = getChipInfoById(id);
43+
ChipInfo *info = chipInfoGetById(id);
4444

4545
return info ? info->page_size : 0;
4646
}

qt/chip_db.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ typedef struct
2626
uint32_t size;
2727
} ChipInfo;
2828

29-
uint32_t getChipDB(ChipInfo *&db);
30-
ChipInfo *getChipInfoByName(char *name);
31-
ChipInfo *getChipInfoById(uint32_t id);
32-
uint32_t getChipPageSize(uint32_t id);
29+
uint32_t chipDbGet(ChipInfo *&db);
30+
ChipInfo *chipInfoGetByName(char *name);
31+
ChipInfo *chipInfoGetById(uint32_t id);
32+
uint32_t chipPageSizeGet(uint32_t id);
3333

3434
#endif // CHIP_DB_H
3535

qt/main_window.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
static void addChipDB(QComboBox *chipSelectComboBox)
2323
{
2424
ChipInfo *db;
25-
uint32_t size = getChipDB(db);
25+
uint32_t size = chipDbGet(db);
2626

2727
for (uint32_t i = 0; i < size; i++)
2828
chipSelectComboBox->addItem(db[i].name);
@@ -176,7 +176,7 @@ void MainWindow::eraseChipCb()
176176
void MainWindow::slotProgErase()
177177
{
178178
QByteArray ba = ui->chipSelectComboBox->currentText().toLatin1();
179-
ChipInfo *chipInfo = getChipInfoByName(ba.data());
179+
ChipInfo *chipInfo = chipInfoGetByName(ba.data());
180180

181181
prog->eraseChip(std::bind(&MainWindow::eraseChipCb, this), START_ADDRESS,
182182
chipInfo->size);
@@ -185,7 +185,7 @@ void MainWindow::slotProgErase()
185185
void MainWindow::readChipCb(int status)
186186
{
187187
QByteArray ba = ui->chipSelectComboBox->currentText().toLatin1();
188-
ChipInfo *chipInfo = getChipInfoByName(ba.data());
188+
ChipInfo *chipInfo = chipInfoGetByName(ba.data());
189189
uint32_t readSize = chipInfo->size;
190190

191191
if (status)
@@ -201,7 +201,7 @@ void MainWindow::readChipCb(int status)
201201
void MainWindow::slotProgRead()
202202
{
203203
QByteArray ba = ui->chipSelectComboBox->currentText().toLatin1();
204-
ChipInfo *chipInfo = getChipInfoByName(ba.data());
204+
ChipInfo *chipInfo = chipInfoGetByName(ba.data());
205205
uint32_t readSize = chipInfo->size;
206206

207207
resetBufTable();
@@ -238,7 +238,7 @@ void MainWindow::slotProgWrite()
238238
return;
239239
}
240240

241-
if (!(pageSize = getChipPageSize(chipId)))
241+
if (!(pageSize = chipPageSizeGet(chipId)))
242242
{
243243
qInfo() << "Chip page size is unknown";
244244
return;

0 commit comments

Comments
 (0)