fome-fw/firmware/console/binary/tunerstudio.h

69 lines
1.4 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file tunerstudio.h
*
* @date Aug 26, 2013
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2020-04-01 16:00:56 -07:00
#pragma once
2018-09-16 19:25:17 -07:00
#include "global.h"
2015-07-10 06:01:56 -07:00
#include "tunerstudio_io.h"
#include "FragmentEntry.h"
2015-07-10 06:01:56 -07:00
typedef struct {
int queryCommandCounter;
int outputChannelsCommandCounter;
int readPageCommandsCounter;
int burnCommandCounter;
int pageCommandCounter;
int writeValueCommandCounter;
int crc32CheckCommandCounter;
int writeChunkCommandCounter;
int errorCounter;
2017-03-26 14:19:08 -07:00
int totalCounter;
int textCommandCounter;
2017-05-09 09:07:52 -07:00
int testCommandCounter;
2015-07-10 06:01:56 -07:00
} tunerstudio_counters_s;
2019-10-08 18:02:51 -07:00
extern tunerstudio_counters_s tsState;
void tunerStudioDebug(TsChannelBase* tsChannel, const char *msg);
void tunerStudioError(TsChannelBase* tsChannel, const char *msg);
uint8_t* getWorkingPageAddr();
#if EFI_TUNER_STUDIO
#include "thread_controller.h"
#include "thread_priority.h"
2021-12-15 17:11:08 -08:00
void updateTunerStudioState();
2022-04-13 21:35:33 -07:00
2015-07-10 06:01:56 -07:00
void requestBurn(void);
void startTunerStudioConnectivity(void);
typedef struct {
short int offset;
short int count;
} TunerStudioWriteChunkRequest;
2015-07-10 06:01:56 -07:00
#if EFI_PROD_CODE || EFI_SIMULATOR
#define CONNECTIVITY_THREAD_STACK (2 * UTILITY_THREAD_STACK_SIZE)
class TunerstudioThread : public ThreadController<CONNECTIVITY_THREAD_STACK> {
public:
TunerstudioThread(const char* name)
: ThreadController(name, PRIO_CONSOLE)
{
}
// Initialize and return the channel to use for this thread.
virtual TsChannelBase* setupChannel() = 0;
void ThreadTask() override;
};
#endif
2015-07-10 06:01:56 -07:00
#endif /* EFI_TUNER_STUDIO */