Compare commits

...

7 Commits

  1. 55
      .vscode/settings.json
  2. 63
      app/src/ads1293_simple_tester.c
  3. 17
      app/src/board/board_beep_ctrl.c
  4. 3
      app/src/board/board_light_ctrl.c
  5. 1
      app/src/board/board_light_ctrl.h
  6. 16513
      bin2/63_whole.hex
  7. 7452
      bin2/app.hex
  8. BIN
      bin2/app3.zip
  9. BIN
      bin2/app4.zip
  10. 16
      bin2/bl_temp.hex
  11. 8
      bin2/build.bat
  12. 16
      bin2/settings.hex
  13. BIN
      only_u2_data_parser/20240206_3ch.xlsx
  14. 2
      only_u2_data_parser/build.bat
  15. 63
      only_u2_data_parser/parse_packet_to_csv.cpp
  16. BIN
      only_u2_data_parser/parse_packet_to_csv.exe
  17. BIN
      only_u2_data_parser/raw.bin
  18. 26099
      only_u2_data_parser/raw.csv
  19. 13324
      only_u2_data_parser/raw.txt
  20. 54
      only_u2_data_parser/text2bin.cpp
  21. BIN
      only_u2_data_parser/text2bin.exe
  22. 7392
      stable/onlyu2_stable_v1.hex
  23. 13324
      stable/stable_v1.txt

55
.vscode/settings.json

@ -108,7 +108,60 @@
"nrf_soc.h": "c",
"sample_data_manager_service.h": "c",
"app_event.h": "c",
"compiler_abstraction.h": "c"
"compiler_abstraction.h": "c",
"ostream": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"random": "cpp",
"ratio": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"numbers": "cpp",
"semaphore": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"board_light_ctrl.h": "c"
},
"files.encoding": "gbk"
}

63
app/src/ads1293_simple_tester.c

@ -9,6 +9,8 @@
#include "app_event_distribute.h"
#include "basic/ads1293/ads1293.h"
#include "board/board.h"
#include "board/board_beep_ctrl.h"
#include "board/board_light_ctrl.h"
#include "device_ctrl_service.h"
#include "nrf_drv_gpiote.h"
#include "sample_data_manager_service.h"
@ -103,17 +105,17 @@ uint32_t get_ready_pin_state_get() { return nrf_gpio_pin_read(ADS1293_READY_PIN)
static adscfg_t m_prvads0cfg[] = //
{
{0x00, 0x00}, {0x01, 0x19}, {0x02, 0x11}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x0f}, {0x08, 0xff}, {0x09, 0x00}, {0x0a, 0x07}, {0x0b, 0x07}, {0x0c, 0x74}, {0x0d, 0x01}, {0x0e, 0x02}, {0x0f, 0x03}, {0x10, 0x04},
{0x00, 0x00}, {0x01, 0x19}, {0x02, 0x11}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x0f}, {0x08, 0x01}, {0x09, 0x00}, {0x0a, 0x07}, {0x0b, 0x07}, {0x0c, 0x74}, {0x0d, 0x01}, {0x0e, 0x02}, {0x0f, 0x03}, {0x10, 0x04},
{0x11, 0x00}, {0x12, 0x05}, {0x13, 0x39}, {0x14, 0x36}, {0x15, 0x06}, {0x16, 0x00}, {0x17, 0x05}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x21, 0x01}, {0x22, 0x20}, {0x23, 0x20}, {0x24, 0x02},
{0x25, 0x00}, {0x26, 0x00}, {0x27, 0x08}, {0x28, 0x08}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x33}, {0x2f, 0x30}, {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00},
{0x25, 0x00}, {0x26, 0x06}, {0x27, 0x08}, {0x28, 0x08}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x33}, {0x2f, 0x30}, {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00},
{0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, {0x40, 0xff}, {0x50, 0x00}, {0x60, 0x00}, {0x62, 0x00},
};
static adscfg_t m_prvads1cfg[] = //
{
{0x00, 0x00}, {0x01, 0x0c}, {0x02, 0x14}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x0f}, {0x08, 0xff}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x07}, {0x0c, 0x78}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, {0x10, 0x04},
{0x00, 0x00}, {0x01, 0x0c}, {0x02, 0x14}, {0x03, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x03}, {0x08, 0x01}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x07}, {0x0c, 0x78}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, {0x10, 0x04},
{0x11, 0x00}, {0x12, 0x07}, {0x13, 0x3b}, {0x14, 0x24}, {0x15, 0x04}, {0x16, 0x00}, {0x17, 0x05}, {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, {0x1c, 0x00}, {0x1d, 0x00}, {0x21, 0x01}, {0x22, 0x20}, {0x23, 0x20}, {0x24, 0x02},
{0x25, 0x00}, {0x26, 0x00}, {0x27, 0x08}, {0x28, 0x40}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x33}, {0x2f, 0x30}, {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00},
{0x25, 0x00}, {0x26, 0x04}, {0x27, 0x00}, {0x28, 0x40}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x33}, {0x2f, 0x30}, {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0x00}, {0x35, 0x00},
{0x36, 0x00}, {0x37, 0x00}, {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, {0x40, 0xff}, {0x50, 0x00}, {0x60, 0x00}, {0x62, 0x00},
};
@ -170,7 +172,7 @@ static void ads1293_init() {
ads1293_spi_writereg_and_check(&m_ads1293_0, m_prvads0cfg[i].add, m_prvads0cfg[i].data);
}
}
#if 1
tryloadcfg_from_fatfs("1.cfg", m_prvads1cfg_cache, ZARRAY_SIZE(m_prvads1cfg_cache), &cfgsize);
if (cfgsize > 0) {
ZLOGI("load 1.cfg from fatfs\n");
@ -189,6 +191,7 @@ static void ads1293_init() {
ads1293_spi_writereg_and_check(&m_ads1293_1, m_prvads1cfg[i].add, m_prvads1cfg[i].data);
}
}
#endif
}
static void onServiceInitCB() {
@ -209,11 +212,13 @@ int main() {
* ÀÑÀ·þÎñ³õʼ»¯ *
*******************************************************************************/
static zble_module_cfg_t cfg;
cfg.deviceName = "ADS1293_TESTER";
cfg.deviceName = "ADS1293_TESTER_3CH_V2";
cfg.on_service_init = onServiceInitCB;
zble_module_init(&cfg);
AppBleService_init();
// znordic_loop();
setup();
}
@ -289,10 +294,11 @@ void trigger_capture() {
// sample[0] = j;
// sample[3] = j;
// sample[4] = j;
// TI_ADS1293_DATA_STATUS_REG
// readystatus[0] = ads1293_read_ready_status(&m_ads1293_0);
// readystatus[1] = ads1293_read_ready_status(&m_ads1293_1);
if (zdatachannel_is_connected()) {
if (BoardLight_getGreenLightEffect() != kLightEffect_open) BoardLight_setGreenLightEffect(kLightEffect_open);
} else {
if (BoardLight_getGreenLightEffect() != kLightEffect_slowFlash) BoardLight_setGreenLightEffect(kLightEffect_slowFlash);
}
{
txpacket.frame[cache_data_size].h1 = 0xA2;
@ -316,17 +322,48 @@ static void ads1293_ready_pin_irq(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t a
trigger_capture();
}
// static void ads1293_spi_tx_rx_0(uint8_t* tx, uint8_t* rx, uint8_t len) {
// nrf_gpio_pin_clear(ADS1293_SPI_CS0_PIN);
// nrf_drv_spi_transfer(&spi, tx, len, rx, len);
// nrf_gpio_pin_set(ADS1293_SPI_CS0_PIN);
// }
// static void ads1293_spi_tx_rx_1(uint8_t* tx, uint8_t* rx, uint8_t len) {
// nrf_gpio_pin_clear(ADS1293_SPI_CS1_PIN);
// nrf_drv_spi_transfer(&spi, tx, len, rx, len);
// nrf_gpio_pin_set(ADS1293_SPI_CS1_PIN);
// }
static void ads1293_start_all_conversion() {
nrf_gpio_pin_clear(ADS1293_SPI_CS0_PIN);
nrf_gpio_pin_clear(ADS1293_SPI_CS1_PIN);
uint8_t txcache[2];
txcache[0] = ADS1293_WRITE_BIT & TI_ADS1293_CONFIG_REG;
txcache[1] = 0x01;
nrf_drv_spi_transfer(&spi, txcache, 2, NULL, 0);
nrf_gpio_pin_set(ADS1293_SPI_CS0_PIN);
nrf_gpio_pin_set(ADS1293_SPI_CS1_PIN);
}
void setup() {
//
zble_module_start_adv();
SampleDataMgr_init();
SampleDataMgr_changeToLocalMode();
ads1293_init();
SampleDataMgr_changeToExtMode();
ads1293_start_conversion(&m_ads1293_0);
ads1293_start_conversion(&m_ads1293_1);
BoardBeepCtrl_init();
BoardLight_Init();
BoardBeepCtrl_load();
BoardLight_setGreenLightEffect(kLightEffect_slowFlash);
BoardBeepCtrl_setEffect(kBoardBeepEffect_threeShortBeep);
// ads1293_start_conversion(&m_ads1293_0);
// ads1293_start_conversion(&m_ads1293_1);
nrf_gpio_cfg_input(ADS1293_READY_PIN, NRF_GPIO_PIN_PULLUP);
@ -340,6 +377,8 @@ void setup() {
nrfx_gpiote_in_event_enable(ADS1293_READY_PIN, true);
}
ads1293_start_all_conversion();
while (true) {
app_sched_execute();
NRF_LOG_PROCESS();

17
app/src/board/board_beep_ctrl.c

@ -1,6 +1,6 @@
#include "board_beep_ctrl.h"
#define BEEP_TIMER_INTERVAL (150)
#if 0
APP_TIMER_DEF(m_beep_tmr); //
static nrf_drv_pwm_t m_beep_pwm0 = NRF_DRV_PWM_INSTANCE(BEEP_PWM_INSTANCE);
static nrf_pwm_values_individual_t m_beep_pwm0_seq_values = {0};
@ -84,6 +84,7 @@ void BoardBeepCtrl_set(uint8_t state) {
nrfx_pwm_simple_playback(&m_beep_pwm0, &m_beep_pwm0_seq, 1, NRF_DRV_PWM_FLAG_LOOP);
} else {
nrfx_pwm_stop(&m_beep_pwm0, true);
nrf_gpio_cfg_input(BEEP_PIN, NRF_GPIO_PIN_NOPULL);
}
}
@ -100,3 +101,17 @@ void BoardBeepCtrl_setEffect(BoardBeepEffect_t effect) {
app_timer_start(m_beep_tmr, APP_TIMER_TICKS(BEEP_TIMER_INTERVAL), NULL);
}
}
#else
static void beep_tmr_handler(void *context) {}
void BoardBeepCtrl_init(void) {}
void BoardBeepCtrl_load() {}
void BoardBeepCtrl_unload() {}
void BoardBeepCtrl_set(uint8_t state) {}
void BoardBeepCtrl_setEffect(BoardBeepEffect_t effect) {}
#endif

3
app/src/board/board_light_ctrl.c

@ -57,6 +57,9 @@ void BoardLight_setGreenLightState(bool state) {
void BoardLight_toggleGreenLightState() { nrf_gpio_pin_toggle(LED_GREEN_PIN); }
LightEffect BoardLight_getGreenLightEffect(){
return m_light_effect;
}
void BoardLight_setGreenLightEffect(LightEffect effect) {
m_light_effect = effect;

1
app/src/board/board_light_ctrl.h

@ -21,3 +21,4 @@ void BoardLight_setGreenLightState(bool state); //
void BoardLight_toggleGreenLightState(); // 使
void BoardLight_setGreenLightEffect(LightEffect effect);
LightEffect BoardLight_getGreenLightEffect();

16513
bin2/63_whole.hex
File diff suppressed because it is too large
View File

7452
bin2/app.hex
File diff suppressed because it is too large
View File

BIN
bin2/app3.zip

BIN
bin2/app4.zip

16
bin2/bl_temp.hex

@ -2978,8 +2978,8 @@
:10DA000010D4070018D4070020D4070028D407003A
:10DA1000000000000090D0030000000000000000A3
:0CDA2000754F0700001000000000080017
:10E000001189F5BB020000000100000001000000C2
:10E0100000000000000000005CF200004B4111A86D
:10E000006AC364A7020000000100000001000000D4
:10E010000000000000000000C0E500008D47E7B2EE
:10E0200001000000000000000000000000000000EF
:10E0300000000000000000000000000000000000E0
:10E0400000000000000000000000000000000000D0
@ -3015,12 +3015,12 @@
:10E2200000000000000000000000000000000000EE
:10E2300000000000000000000000000000000000DE
:10E2400000000000000000000000000000000000CE
:10E25000000000000000000000000000388FD9CF4F
:10E25000000000000000000000000000E9DAEFC646
:10E2600000000000000000000000000000000000AE
:10E27000000000000000000000000000000000009E
:10E28000000000000000000000000000000000008E
:10E29000000000000000000000000000000000007E
:10E2A00000014B4111A80000000000000000000028
:10E2A00000018D47E7B20000000000000000000000
:10E2B000000000000000000000000000000000005E
:10E2C000000000000000000000000000000000004E
:10E2D000000000000000000000000000000000003E
@ -3029,8 +3029,8 @@
:10E30000000000000000000000000000000000000D
:10E3100000000000000000000000000000000000FD
:04E32000000000FFFA
:10F000001189F5BB020000000100000001000000B2
:10F0100000000000000000005CF200004B4111A85D
:10F000006AC364A7020000000100000001000000C4
:10F010000000000000000000C0E500008D47E7B2DE
:10F0200001000000000000000000000000000000DF
:10F0300000000000000000000000000000000000D0
:10F0400000000000000000000000000000000000C0
@ -3066,12 +3066,12 @@
:10F2200000000000000000000000000000000000DE
:10F2300000000000000000000000000000000000CE
:10F2400000000000000000000000000000000000BE
:10F25000000000000000000000000000388FD9CF3F
:10F25000000000000000000000000000E9DAEFC636
:10F26000000000000000000000000000000000009E
:10F27000000000000000000000000000000000008E
:10F28000000000000000000000000000000000007E
:10F29000000000000000000000000000000000006E
:10F2A00000014B4111A80000000000000000000018
:10F2A00000018D47E7B200000000000000000000F0
:10F2B000000000000000000000000000000000004E
:10F2C000000000000000000000000000000000003E
:10F2D000000000000000000000000000000000002E

8
bin2/build.bat

@ -2,7 +2,7 @@ copy ..\app\_build\app.hex .
nrfutil settings generate --family NRF52 --application app.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 settings.hex
mergehex --merge bootloader.hex settings.hex --output bl_temp.hex
mergehex --merge bl_temp.hex app.hex s140_nrf52_7.2.0_softdevice.hex --output whole.hex
nrfjprog --eraseall -f NRF52
nrfjprog --program whole.hex --verify -f NRF52
nrfjprog -f nrf52 --memwr 0x10001080 --val 0x00000011
nrfjprog --reset -f NRF52
@REM nrfjprog --eraseall -f NRF52
@REM nrfjprog --program whole.hex --verify -f NRF52
@REM nrfjprog -f nrf52 --memwr 0x10001080 --val 0x00000011
@REM nrfjprog --reset -f NRF52

16
bin2/settings.hex

@ -1,6 +1,6 @@
:020000040007F3
:10E000001189F5BB020000000100000001000000C2
:10E0100000000000000000005CF200004B4111A86D
:10E000006AC364A7020000000100000001000000D4
:10E010000000000000000000C0E500008D47E7B2EE
:10E0200001000000000000000000000000000000EF
:10E0300000000000000000000000000000000000E0
:10E0400000000000000000000000000000000000D0
@ -36,12 +36,12 @@
:10E2200000000000000000000000000000000000EE
:10E2300000000000000000000000000000000000DE
:10E2400000000000000000000000000000000000CE
:10E25000000000000000000000000000388FD9CF4F
:10E25000000000000000000000000000E9DAEFC646
:10E2600000000000000000000000000000000000AE
:10E27000000000000000000000000000000000009E
:10E28000000000000000000000000000000000008E
:10E29000000000000000000000000000000000007E
:10E2A00000014B4111A80000000000000000000028
:10E2A00000018D47E7B20000000000000000000000
:10E2B000000000000000000000000000000000005E
:10E2C000000000000000000000000000000000004E
:10E2D000000000000000000000000000000000003E
@ -50,8 +50,8 @@
:10E30000000000000000000000000000000000000D
:10E3100000000000000000000000000000000000FD
:04E32000000000FFFA
:10F000001189F5BB020000000100000001000000B2
:10F0100000000000000000005CF200004B4111A85D
:10F000006AC364A7020000000100000001000000C4
:10F010000000000000000000C0E500008D47E7B2DE
:10F0200001000000000000000000000000000000DF
:10F0300000000000000000000000000000000000D0
:10F0400000000000000000000000000000000000C0
@ -87,12 +87,12 @@
:10F2200000000000000000000000000000000000DE
:10F2300000000000000000000000000000000000CE
:10F2400000000000000000000000000000000000BE
:10F25000000000000000000000000000388FD9CF3F
:10F25000000000000000000000000000E9DAEFC636
:10F26000000000000000000000000000000000009E
:10F27000000000000000000000000000000000008E
:10F28000000000000000000000000000000000007E
:10F29000000000000000000000000000000000006E
:10F2A00000014B4111A80000000000000000000018
:10F2A00000018D47E7B200000000000000000000F0
:10F2B000000000000000000000000000000000004E
:10F2C000000000000000000000000000000000003E
:10F2D000000000000000000000000000000000002E

BIN
only_u2_data_parser/20240206_3ch.xlsx

2
only_u2_data_parser/build.bat

@ -0,0 +1,2 @@
g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ text2bin.cpp -o text2bin.exe
g++ -static -static-libgcc -static-libstdc++ -lwsock32 -lstdc++ parse_packet_to_csv.cpp -o parse_packet_to_csv.exe

63
only_u2_data_parser/parse_packet_to_csv.cpp

@ -0,0 +1,63 @@
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
//
#include <winsock2.h>
//
#include <Windows.h>
//
#include <stdio.h>
#pragma comment(lib, "ws2_32.lib")
#define PORT 8988
#pragma pack(1)
typedef struct parse_packet_to_csv {
uint8_t h0;
uint8_t h1;
uint32_t ch0;
uint32_t ch1;
uint32_t ch2;
uint8_t e0;
uint8_t e1;
};
#pragma pack()
int main(int argc, char* argv[]) {
/**
* @brief
* raw.bin
* raw.bin全部内容
*
*/
std::ifstream ifs("raw.bin", std::ios::binary);
std::vector<char> buffer((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
ifs.close();
printf("buffer.size() = %d\n", buffer.size());
// 将通道数据存储到raw.csv
std::ofstream ofs("raw.csv");
ofs << "II,V1,V5\n";
for (size_t i = 0; i < buffer.size();) {
parse_packet_to_csv* packet = (parse_packet_to_csv*)&buffer[i];
if (packet->h0 == 0xA2 && packet->h1 == 0x02 && packet->e0 == 0x02 && packet->e1 == 0xA2) {
// printf("ch0 = %d, ch1 = %d, ch2 = %d\n", packet->ch0, packet->ch1, packet->ch2);
ofs << packet->ch0 << "," << packet->ch1 << "," << packet->ch2 << "\n";
i += sizeof(parse_packet_to_csv);
} else {
i++;
}
}
return 0;
}

BIN
only_u2_data_parser/parse_packet_to_csv.exe

BIN
only_u2_data_parser/raw.bin

26099
only_u2_data_parser/raw.csv
File diff suppressed because it is too large
View File

13324
only_u2_data_parser/raw.txt
File diff suppressed because it is too large
View File

54
only_u2_data_parser/text2bin.cpp

@ -0,0 +1,54 @@
#include <fstream>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
//
#include <winsock2.h>
//
#include <Windows.h>
//
#include <stdio.h>
#pragma comment(lib, "ws2_32.lib")
#define PORT 8988
int main(int argc, char *argv[]) {
/**
* @brief
* raw.txt
* raw.txt全部内容
*
* 16
* raw.bin
*/
std::ifstream ifs("raw.txt");
std::string str((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
ifs.close();
std::string str2;
for (auto &c : str) {
if (c == ' ' || c == '\n' || c == '\r') {
continue;
}
str2.push_back(c);
}
std::ofstream ofs("raw.bin", std::ios::binary);
for (size_t i = 0; i < str2.size(); i += 2) {
std::string str3 = str2.substr(i, 2);
char c = (char)std::stoi(str3, nullptr, 16);
ofs.write(&c, 1);
}
ofs.close();
return 0;
}

BIN
only_u2_data_parser/text2bin.exe

7392
stable/onlyu2_stable_v1.hex
File diff suppressed because it is too large
View File

13324
stable/stable_v1.txt
File diff suppressed because it is too large
View File

Loading…
Cancel
Save