Skip to content

Commit 75501d4

Browse files
committed
remove DSP demo
1 parent a01b336 commit 75501d4

File tree

3 files changed

+0
-90
lines changed

3 files changed

+0
-90
lines changed

ports/raspberrypi/bindings/rp2pio/StateMachine.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,43 +1090,6 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_last_write_obj, rp2pio_statema
10901090
MP_PROPERTY_GETTER(rp2pio_statemachine_last_write_obj,
10911091
(mp_obj_t)&rp2pio_statemachine_get_last_write_obj);
10921092

1093-
static mp_obj_t rp2pio_statemachine_process(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
1094-
enum { ARG_target, ARG_parameters, ARG_input };
1095-
static const mp_arg_t allowed_args[] = {
1096-
{ MP_QSTR_target, MP_ARG_OBJ, {.u_obj = mp_const_none} },
1097-
{ MP_QSTR_parameters, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} },
1098-
{ MP_QSTR_input, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} },
1099-
};
1100-
rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
1101-
check_for_deinit(self);
1102-
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
1103-
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
1104-
1105-
size_t stride_in_bytes = 0;
1106-
sm_buf_info target_buf_info, parameters_buf_info, input_buf_info;
1107-
1108-
fill_buf_info(&target_buf_info, args[ARG_target].u_obj, &stride_in_bytes, MP_BUFFER_WRITE);
1109-
fill_buf_info(&parameters_buf_info, args[ARG_parameters].u_obj, &stride_in_bytes, MP_BUFFER_WRITE);
1110-
fill_buf_info(&input_buf_info, args[ARG_input].u_obj, &stride_in_bytes, MP_BUFFER_WRITE);
1111-
1112-
if (!stride_in_bytes) {
1113-
return mp_const_none;
1114-
}
1115-
1116-
bool ok = common_hal_rp2pio_statemachine_process(self, stride_in_bytes, &target_buf_info, &parameters_buf_info, &input_buf_info);
1117-
1118-
if (mp_hal_is_interrupted()) {
1119-
return mp_const_none;
1120-
}
1121-
if (!ok) {
1122-
mp_raise_OSError(MP_EIO);
1123-
}
1124-
return mp_const_none;
1125-
}
1126-
MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_process_obj, 1, rp2pio_statemachine_process);
1127-
1128-
1129-
11301093
static const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = {
11311094
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&rp2pio_statemachine_deinit_obj) },
11321095
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) },
@@ -1166,8 +1129,6 @@ static const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = {
11661129
{ MP_ROM_QSTR(MP_QSTR_last_read), MP_ROM_PTR(&rp2pio_statemachine_last_read_obj) },
11671130
{ MP_ROM_QSTR(MP_QSTR_last_write), MP_ROM_PTR(&rp2pio_statemachine_last_write_obj) },
11681131

1169-
{ MP_ROM_QSTR(MP_QSTR_process), MP_ROM_PTR(&rp2pio_statemachine_process_obj) },
1170-
11711132
};
11721133
static MP_DEFINE_CONST_DICT(rp2pio_statemachine_locals_dict, rp2pio_statemachine_locals_dict_table);
11731134

ports/raspberrypi/bindings/rp2pio/StateMachine.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,3 @@ mp_obj_t common_hal_rp2pio_statemachine_get_rxfifo(rp2pio_statemachine_obj_t *se
9191

9292
mp_obj_t common_hal_rp2pio_statemachine_get_last_read(rp2pio_statemachine_obj_t *self);
9393
mp_obj_t common_hal_rp2pio_statemachine_get_last_write(rp2pio_statemachine_obj_t *self);
94-
95-
bool common_hal_rp2pio_statemachine_process(rp2pio_statemachine_obj_t *self, uint8_t stride_in_bytes,
96-
sm_buf_info *target_buf_info, sm_buf_info *parameters_buf_info, sm_buf_info *input_buf_info);

ports/raspberrypi/common-hal/rp2pio/StateMachine.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,54 +1426,6 @@ mp_obj_t common_hal_rp2pio_statemachine_get_last_write(rp2pio_statemachine_obj_t
14261426
return mp_const_empty_bytes;
14271427
}
14281428

1429-
bool common_hal_rp2pio_statemachine_process(rp2pio_statemachine_obj_t *self, uint8_t stride_in_bytes,
1430-
sm_buf_info *target_buf_info, sm_buf_info *parameters_buf_info, sm_buf_info *input_buf_info) {
1431-
if (parameters_buf_info->info.len > 2) {
1432-
if (stride_in_bytes == 2) {
1433-
int16_t op = ((int16_t *)parameters_buf_info->info.buf)[0];
1434-
int16_t *target;
1435-
target = (int16_t *)target_buf_info->info.buf;
1436-
1437-
switch (op) {
1438-
case 1: // multiply
1439-
int16_t *factor;
1440-
uint16_t *factor_index;
1441-
size_t factor_samples;
1442-
factor_samples = (parameters_buf_info->info.len - (2 * stride_in_bytes)) / stride_in_bytes;
1443-
factor_index = ((uint16_t *)(parameters_buf_info->info.buf)) + 1;
1444-
factor = ((int16_t *)(parameters_buf_info->info.buf)) + 2;
1445-
for (size_t i = 0; i < (target_buf_info->info.len / stride_in_bytes); i++) {
1446-
target[i] = ((int32_t)target[i] * (int32_t)factor[*factor_index]) >> 16;
1447-
(*factor_index)++;
1448-
if (*factor_index >= factor_samples) {
1449-
*factor_index = 0;
1450-
}
1451-
}
1452-
break;
1453-
1454-
case 2: // echo
1455-
int16_t *memory;
1456-
uint16_t *memory_index;
1457-
size_t memory_samples;
1458-
memory_samples = (parameters_buf_info->info.len - (2 * stride_in_bytes)) / stride_in_bytes;
1459-
memory_index = ((uint16_t *)(parameters_buf_info->info.buf)) + 1;
1460-
memory = ((int16_t *)(parameters_buf_info->info.buf)) + 2;
1461-
for (size_t i = 0; i < (target_buf_info->info.len / stride_in_bytes); i++) {
1462-
target[i] = (target[i] + (memory[*memory_index] >> 1)) >> 1; // fixed 50% decay for now
1463-
memory[*memory_index] = target[i];
1464-
(*memory_index)++;
1465-
if (*memory_index >= memory_samples) {
1466-
*memory_index = 0;
1467-
}
1468-
}
1469-
break;
1470-
}
1471-
}
1472-
}
1473-
return 1;
1474-
}
1475-
1476-
14771429

14781430
// Use a compile-time constant for MP_REGISTER_POINTER so the preprocessor will
14791431
// not split the expansion across multiple lines.

0 commit comments

Comments
 (0)