src/occ_405/wof/wof.c
/**
 * calculate_ceff_ratio_vdn
 *
 * Description: Function to calculate the effective capacitance ratio
 *              for the nest
 */
calculate_ceff_ratio_vdn
Description: Function to calculate the effective capacitance ratio
for the nest
calculate_ceff_ratio_vdn Description : Function to calculate the effective capacitance ratio for the nest
void calculate_ceff_ratio_vdn( void )
{
    g_wof->ceff_tdp_vdn = G_oppb.ceff_tdp_vdn;
    g_wof->c_ratio_vdn_freq = G_nest_frequency_mhz;
    g_wof->ceff_vdn =
                calculate_effective_capacitance( g_wof->iac_vdn,
                                                 g_wof->voltvdn_sensor,
                                                 g_wof->c_ratio_vdn_freq );
    if( g_wof->ceff_tdp_vdn == 0 )
    {
        INTR_TRAC_ERR("WOF Disabled! Ceff VDN divide by 0");
        print_oppb();
        g_wof->ceff_ratio_vdn = 0;
        set_clear_wof_disabled(SET,
                               WOF_RC_DIVIDE_BY_ZERO_VDN,
                               ERC_WOF_DIVIDE_BY_ZERO_VDN);
    }
    else
    {
        g_wof->ceff_ratio_vdn = g_wof->ceff_vdn / g_wof->ceff_tdp_vdn;
    }
}
void calculate_ceff_ratio_vdn ( void ) { g_wof -> ceff_tdp_vdn = G_oppb . ceff_tdp_vdn ; g_wof -> c_ratio_vdn_freq = G_nest_frequency_mhz ; g_wof -> ceff_vdn = calculate_effective_capacitance ( g_wof -> iac_vdn , g_wof -> voltvdn_sensor , g_wof -> c_ratio_vdn_freq ) ; if ( g_wof -> ceff_tdp_vdn == 0 ) { INTR_TRAC_ERR ( " " ) ; print_oppb ( ) ; g_wof -> ceff_ratio_vdn = 0 ; set_clear_wof_disabled ( SET , WOF_RC_DIVIDE_BY_ZERO_VDN , ERC_WOF_DIVIDE_BY_ZERO_VDN ) ; } else { g_wof -> ceff_ratio_vdn = g_wof -> ceff_vdn / g_wof -> ceff_tdp_vdn ; } }
calculate_ceff_ratio_vdn
 Description: Function to calculate the effective capacitance ratio
              for the nest
calculate_ceff_ratio_vdn Description : Function to calculate the effective capacitance ratio for the nest
// Get ceff_tdp_vdn from OCCPPB // Calculate ceff_vdn // iac_vdn/ (VOLTVDN^1.3 * Fnest) // Prevent divide by zero // Return 0