Skip to content

Commit cfcc920

Browse files
committed
feat: add ROM function wrappers
1 parent 067e5d8 commit cfcc920

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ endif()
1212

1313
set(srcs
1414
src/flash.c
15+
src/rom_wrappers.c
1516
)
1617

1718
if(STUB_LOG_ENABLED IN_LIST STUB_COMPILE_DEFS)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0 OR MIT
5+
*/
6+
7+
#pragma once
8+
9+
#include <stdint.h>
10+
11+
void esp_stub_lib_delay_us(uint32_t us);
12+
uint16_t esp_stub_lib_crc16_le(uint16_t crc, const uint8_t *buf, uint32_t len);

src/rom_wrappers.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0 OR MIT
5+
*/
6+
#include <stdint.h>
7+
8+
extern void ets_delay_us(uint32_t us);
9+
extern uint16_t crc16_le(uint16_t crc, const uint8_t *buf, uint32_t len);
10+
11+
void esp_stub_lib_delay_us(uint32_t us)
12+
{
13+
ets_delay_us(us);
14+
}
15+
16+
uint16_t esp_stub_lib_crc16_le(uint16_t crc, const uint8_t *buf, uint32_t len)
17+
{
18+
return crc16_le(crc, buf, len);
19+
}

0 commit comments

Comments
 (0)