Simplfy the code, remove code about display LCD
    not sure whether it is actually run
    i.e. g_uFlag not change value