Загрузить файлы в «src»

This commit is contained in:
ambrozevich.sa committed 2026-10-20 15:09:06 +03:00
1 parent 1d50fb3c8f
commit 9ccb682234
3 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -169,7 +169,7 @@ int16_t _ps2000_math_adc_convert(int16_t raw, double gain, double corr_offset) {
val *= gain;
/* Scale back to ADC counts for output */
val *= PS2000_ADC_FULL_SCALE;
/* REMOVED: val *= PS2000_ADC_FULL_SCALE; (spurious) */
/* Truncate to integer (cvttsd2si) */
int32_t converted = (int32_t)(int64_t)val;
+1 -1
View File
@@ -180,7 +180,7 @@ int _ps2000_ops_siggen_default_init(ps2000_context_t *ctx) {
ctx->siggen.config = PS2000_SIGGEN_DEFAULT;
/* Check capabilities bitmap for specific feature */
if (ctx->info.eeprom_valid == 0x10) {
if (_ps2000_ops_check_capability(ctx, 4)) { /* bit 4 = 0x10 */
/* Extended initialization for capable devices */
ctx->siggen.awg_config_flag = 1;
}
+6 -1
View File
@@ -41,7 +41,12 @@ ps2000_status_t _ps2000_thr_create(pthread_t *thr, const char *name,
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 1024 * 1024); /* 1MB stack */
int ret = pthread_create(thr, &attr, _ps2000_thr_trampoline, (void*)&func);
_ps2000_thr_ctx_t *thr_ctx = (_ps2000_thr_ctx_t*)malloc(sizeof(_ps2000_thr_ctx_t));
if (!thr_ctx) { pthread_attr_destroy(&attr); return PS2000_ERR_MEMORY; }
thr_ctx->func = func;
thr_ctx->arg = arg;
int ret = pthread_create(thr, &attr, _ps2000_thr_trampoline, thr_ctx);
if (ret != 0) free(thr_ctx);
pthread_attr_destroy(&attr);
if (ret != 0) {