Exemplo n.º 1
0
//==============================================================================
void ReadTarget::on_read(const ByteVector &data) const
{
	if (file_format_ == "hex")
	{
		DataSectionStore store;
		store.add_section(DataSection(0, data), true);
		hex_file_save(file_name_, store);
	}
	if (file_format_ == "bin")
		binary_file_save(file_name_, data);
}
Exemplo n.º 2
0
//==============================================================================
void CC_UnitDriver::write_lock_to_info_page(uint8_t lock_byte)
{
    select_info_page_flash(true);

    ByteVector data;
    data.push_back(0xFF);
    data.push_back(lock_byte);

    DataSectionStore store;
    store.add_section(DataSection(0, data), true);
    write_flash_slow(store);

    select_info_page_flash(false);
}
Exemplo n.º 3
0
static
BOOL ParseIT8(LPIT8 it8)
{

    InSymbol(it8);

    if (it8->sy == SIDENT) {

            strncpy(it8->SheetType, it8->id, MAXSTR-1);
            InSymbol(it8);

            /* if (!AddAvailableProperty(it8, it8 -> id)) return false; */
            /* cmsxIT8SetProperty((LCMSHANDLE) it8, it8->id, NULL); */
    }

    Skip(it8, SEOLN);

    while (it8-> sy != SEOF &&
           it8-> sy != SSYNERROR) {

            switch (it8 -> sy) {

            case SBEGIN_DATA_FORMAT:
                    if (!DataFormatSection(it8)) return false;
                    break;

            case SBEGIN_DATA:
                    if (!DataSection(it8)) return false;
                    break;

            case SEOLN:
                    Skip(it8, SEOLN);
                    break;

            default:
                    if (!HeaderSection(it8)) return false;
           }

    }

    return true;
}